From: Lars-Peter Clausen <lars@metafoo.de>
To: Jonathan Cameron <jic23@kernel.org>
Cc: linux-iio@vger.kernel.org, pirmin.duss@flytec.ch
Subject: Re: [RFC PATCH 0/6] Make iio_info elements attrs and event_attrs struct attribute *
Date: Tue, 03 Jan 2012 10:44:17 +0100 [thread overview]
Message-ID: <4F02CDF1.8040504@metafoo.de> (raw)
In-Reply-To: <1325525123-31158-1-git-send-email-jic23@kernel.org>
On 01/02/2012 06:25 PM, Jonathan Cameron wrote:
> This came up whilst I was taking a look at Pirmin Duss' driver the ot=
her day.
> When we originally created these the attribute groups were passed dir=
ectly
> through the core and registered with sysfs. Since the introduction o=
f
> iio_chan_spec structures this is no longer true. Their elements are =
simply
> coppied into attribute_groups created by the core.
>=20
> Hence, what other reasons are there for having these as attribute gro=
ups?
> The only one I can see is the availablity of the is_visible callback.
>=20
> Now I've always had mixed feelings about that one. It's handy on occa=
sion
> but mostly gets used to handle variations across the different device=
s
> that are supported by a given driver. This is true of ad7192, ad9834=
,
> ad5446 (indirectly). These can all be easily unwound and handled at =
a
> higher level (which iio_info varient we use for the device instance).
This sounds sensible.
>=20
> The ad7606 is the only more complex use case here. There we have
> attributes whose visibility is dependent on some gpios being specifie=
d
> in platform data. There are two different sets so we have a total of=
4
> resulting iio_info structures. Not too bad I suppose.
But this is getting a bit ugly in my opinion. Maybe we can add a attrs
fields to the iio_dev struct to handle these. This would also allow us =
to
allocate attributes at runtime if necessary.
>=20
> A side effect of this is that we can remove the code Lars-Peter just =
added
> to copy the is_visible callback over. =20
Hm, while I have such a patch locally I don=92t think I've send it out =
yet.
> That copy is a little odd anyway
> as it is applied to far more attributes than are initially visible. =
whilst
> all current drivers do a 'is condition true then mask attribute' we o=
nly
> need one to do the reverse logic to get nasty to find bug.
>=20
> Note this set is on top of Lars-Peters recent rearrangement of the ev=
ent
> code as obviously the last patch here edits code he moves.
- Lars
next prev parent reply other threads:[~2012-01-03 9:43 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-01-02 17:25 [RFC PATCH 0/6] Make iio_info elements attrs and event_attrs struct attribute * Jonathan Cameron
2012-01-02 17:25 ` [PATCH 1/6] staging:iio:adc:ad7192 unwind use of is_visible for attribute group Jonathan Cameron
2012-01-02 17:25 ` [PATCH 4/6] staging:iio:adc:ad7606 unwind use of is_visible for attrs Jonathan Cameron
2012-01-02 17:25 ` [PATCH 5/6] staging:iio:adc:adt7310/7410 sticking plaster fix for broken event attrs Jonathan Cameron
2012-01-02 17:25 ` [PATCH 6/6] staging:iio:treewide make attrs and event_attrs entries struct attribute * Jonathan Cameron
2012-01-03 9:44 ` Lars-Peter Clausen [this message]
2012-01-03 17:24 ` [RFC PATCH 0/6] Make iio_info elements attrs and event_attrs " Jonathan Cameron
[not found] ` <1325525123-31158-3-git-send-email-jic23@kernel.org>
2012-01-03 9:45 ` [PATCH 2/6] staging:iio:dds:ad9834 unwind use of is_visible for attrs Lars-Peter Clausen
2012-01-03 17:12 ` Jonathan Cameron
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=4F02CDF1.8040504@metafoo.de \
--to=lars@metafoo.de \
--cc=jic23@kernel.org \
--cc=linux-iio@vger.kernel.org \
--cc=pirmin.duss@flytec.ch \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.