Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753219AbcLLTER (ORCPT ); Mon, 12 Dec 2016 14:04:17 -0500 Received: from mail-pg0-f48.google.com ([74.125.83.48]:35623 "EHLO mail-pg0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752855AbcLLTEN (ORCPT ); Mon, 12 Dec 2016 14:04:13 -0500 Date: Mon, 12 Dec 2016 11:04:04 -0800 From: Bjorn Andersson To: Imran Khan Cc: andy.gross@linaro.org, lee.jones@linaro.org, David Brown , open list , "open list:ARM/QUALCOMM SUPPORT" , "open list:ARM/QUALCOMM SUPPORT" Subject: Re: [PATCH v5] soc: qcom: Add SoC info driver Message-ID: <20161212190404.GA3439@tuxbot> References: <1479302540-16690-1-git-send-email-kimran@codeaurora.org> <20161205180503.GK9322@tuxbot> <70a5a48a-4b6c-f564-99e4-758a9c5d598a@codeaurora.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <70a5a48a-4b6c-f564-99e4-758a9c5d598a@codeaurora.org> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1043 Lines: 30 On Mon 12 Dec 07:14 PST 2016, Imran Khan wrote: > On 12/5/2016 11:35 PM, Bjorn Andersson wrote: [..] > > > > Rather than having this based on two huge macros take a look at > > DEVICE_INT_ATTR() and struct dev_ext_attribute in > > include/linux/device.h. It looks like if you just put the index in a > > struct and use container_of to reach that you can replace these with > > direct functions. > > > > Also, it's perfectly fine to always specify a store operation and use > > 0444 vs 0644 to control it's availability. So you don't need two sets if > > you just expose the mode in your macro. > > > > If I understood this correct, the main idea here is to use dev_ext_attribute > and avoid wrapper macros. Have tried to implement this suggestion in the > subsequent patch set. Please let me know if it looks okay or can be improved > further. > Not necessarily using dev_ext_attribute directly, but using the same design (a struct and container_of) allows you do parameterize these functions. Looking forward to v6. Regards, Bjorn