linux-arm-msm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bjorn Andersson <bjorn.andersson@linaro.org>
To: Imran Khan <kimran@codeaurora.org>
Cc: andy.gross@linaro.org, lee.jones@linaro.org,
	David Brown <david.brown@linaro.org>,
	open list <linux-kernel@vger.kernel.org>,
	"open list:ARM/QUALCOMM SUPPORT" <linux-arm-msm@vger.kernel.org>,
	"open list:ARM/QUALCOMM SUPPORT" <linux-soc@vger.kernel.org>
Subject: Re: [PATCH v5] soc: qcom: Add SoC info driver
Date: Mon, 12 Dec 2016 11:04:04 -0800	[thread overview]
Message-ID: <20161212190404.GA3439@tuxbot> (raw)
In-Reply-To: <70a5a48a-4b6c-f564-99e4-758a9c5d598a@codeaurora.org>

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

      reply	other threads:[~2016-12-12 19:04 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-16 13:22 [PATCH v5] soc: qcom: Add SoC info driver Imran Khan
2016-12-05 18:05 ` Bjorn Andersson
2016-12-12 15:14   ` Imran Khan
2016-12-12 19:04     ` Bjorn Andersson [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20161212190404.GA3439@tuxbot \
    --to=bjorn.andersson@linaro.org \
    --cc=andy.gross@linaro.org \
    --cc=david.brown@linaro.org \
    --cc=kimran@codeaurora.org \
    --cc=lee.jones@linaro.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-soc@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).