* [RFC] Make the devm_iio_device_alloc call set iio_dev.dev.parent.
@ 2016-05-04 10:56 Jonathan Cameron
2016-05-15 17:55 ` Jonathan Cameron
0 siblings, 1 reply; 3+ messages in thread
From: Jonathan Cameron @ 2016-05-04 10:56 UTC (permalink / raw)
To: linux-iio@vger.kernel.org
Hi All,
One thing that I discovered via a recent input device review is that
the equivalent of our devm_iio_device_alloc there also sets the
dev.parent.
Should we do the same in IIO?
I'm a bit in too minds as it feels like it is only sort of 'part of the
allocation'.
Still it drops one line from nearly every IIO driver.
Could do the same for dev_iio_trigger_alloc as well I guess for double
savings.
Anyhow, a little cleanup that seemed like a moderately good idea to
me so I thought I'd see what the general view was.
Jonathan
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [RFC] Make the devm_iio_device_alloc call set iio_dev.dev.parent.
2016-05-04 10:56 [RFC] Make the devm_iio_device_alloc call set iio_dev.dev.parent Jonathan Cameron
@ 2016-05-15 17:55 ` Jonathan Cameron
2016-05-16 6:02 ` Matt Ranostay
0 siblings, 1 reply; 3+ messages in thread
From: Jonathan Cameron @ 2016-05-15 17:55 UTC (permalink / raw)
To: linux-iio@vger.kernel.org, Matt Ranostay
On 04/05/16 11:56, Jonathan Cameron wrote:
> Hi All,
>
> One thing that I discovered via a recent input device review is that
> the equivalent of our devm_iio_device_alloc there also sets the
> dev.parent.
>
> Should we do the same in IIO?
>
> I'm a bit in too minds as it feels like it is only sort of 'part of the
> allocation'.
>
> Still it drops one line from nearly every IIO driver.
> Could do the same for dev_iio_trigger_alloc as well I guess for double
> savings.
>
> Anyhow, a little cleanup that seemed like a moderately good idea to
> me so I thought I'd see what the general view was.
>
> Jonathan
I'm gong ahead with this - just for reference purposes the oddities so far
are:
stx104 which never set the parent.
max30100 which never sets the parent.
apds9960 which never sets the parent.
ms5611_i2c never sets the parent.
pulsed_light lidar never sets the parent.
lm3533 which sets the iio device parent to the mfd device parent, but allocates
on the devm against the mfd. I'm not certain this is how it should have been done
but now it is abi so we have to cope with it.
We can handle this just fine by letting it override the default.
Each patch is simple enough I'll probably just do this in one or two mega patches
rather than one per driver...
Same trick applies for the devm_iio_trigger_alloc though that is used rather less.
Jonathan
> --
> To unsubscribe from this list: send the line "unsubscribe linux-iio" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [RFC] Make the devm_iio_device_alloc call set iio_dev.dev.parent.
2016-05-15 17:55 ` Jonathan Cameron
@ 2016-05-16 6:02 ` Matt Ranostay
0 siblings, 0 replies; 3+ messages in thread
From: Matt Ranostay @ 2016-05-16 6:02 UTC (permalink / raw)
To: Jonathan Cameron; +Cc: linux-iio@vger.kernel.org
On Sun, May 15, 2016 at 10:55 AM, Jonathan Cameron <jic23@kernel.org> wrote:
> On 04/05/16 11:56, Jonathan Cameron wrote:
>> Hi All,
>>
>> One thing that I discovered via a recent input device review is that
>> the equivalent of our devm_iio_device_alloc there also sets the
>> dev.parent.
>>
>> Should we do the same in IIO?
>>
>> I'm a bit in too minds as it feels like it is only sort of 'part of the
>> allocation'.
>>
>> Still it drops one line from nearly every IIO driver.
>> Could do the same for dev_iio_trigger_alloc as well I guess for double
>> savings.
>>
>> Anyhow, a little cleanup that seemed like a moderately good idea to
>> me so I thought I'd see what the general view was.
>>
>> Jonathan
>
> I'm gong ahead with this - just for reference purposes the oddities so far
> are:
> stx104 which never set the parent.
> max30100 which never sets the parent.
> apds9960 which never sets the parent.
> ms5611_i2c never sets the parent.
> pulsed_light lidar never sets the parent.
Yike! I caused 3 odd drivers here :)
>
> lm3533 which sets the iio device parent to the mfd device parent, but allocates
> on the devm against the mfd. I'm not certain this is how it should have been done
> but now it is abi so we have to cope with it.
> We can handle this just fine by letting it override the default.
>
> Each patch is simple enough I'll probably just do this in one or two mega patches
> rather than one per driver...
>
> Same trick applies for the devm_iio_trigger_alloc though that is used rather less.
>
> Jonathan
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-iio" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at http://vger.kernel.org/majordomo-info.html
>>
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-05-16 6:04 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-05-04 10:56 [RFC] Make the devm_iio_device_alloc call set iio_dev.dev.parent Jonathan Cameron
2016-05-15 17:55 ` Jonathan Cameron
2016-05-16 6:02 ` Matt Ranostay
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).