Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1540558
| From | Bjorn Andersson <bjorn.andersson@linaro.org> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH v5] soc: qcom: Add SoC info driver |
| Date | 2016-12-12 20:10 +0100 |
| Message-ID | <sNE94-8b3-37@gated-at.bofh.it> (permalink) |
| References | <sE8rM-3nS-37@gated-at.bofh.it> <sL5Sa-7U6-19@gated-at.bofh.it> <sNAyt-5Y2-17@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
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
Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread
Re: [PATCH v5] soc: qcom: Add SoC info driver Imran Khan <kimran@codeaurora.org> - 2016-12-12 16:20 +0100 Re: [PATCH v5] soc: qcom: Add SoC info driver Bjorn Andersson <bjorn.andersson@linaro.org> - 2016-12-12 20:10 +0100
csiph-web