* questions regarding drivers/staging/iio/accel/sca3000_core.c
@ 2014-07-21 8:24 Himangi Saraogi
2014-07-27 16:24 ` Jonathan Cameron
0 siblings, 1 reply; 2+ messages in thread
From: Himangi Saraogi @ 2014-07-21 8:24 UTC (permalink / raw)
To: Jonathan Cameron, Greg Kroah-Hartman, linux-iio, devel,
linux-kernel
Cc: Julia Lawall
[-- Attachment #1: Type: text/plain, Size: 596 bytes --]
Hi,
I was looking at the possibility of using a managed interface for
iio_device_register in sca3000_probe. But this will lead to the
iio_device_unregisterfunction being called after sca3000_unconfigure_ring
in the remove function. I have a few queries:
1. Is it safe to move the unregister function over the
sca3000_unconfigure_ring?
2. Is it correct that on failure the probe function does not call
sca3000_unconfigure_ring?
3. If it is fine moving unregister after sca3000_unconfigure_ring, I
propose to add a devm counterpart of iio_buffer_unregister. Is it a good
idea?
Thanks,
Himangi
[-- Attachment #2: Type: text/html, Size: 696 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: questions regarding drivers/staging/iio/accel/sca3000_core.c
2014-07-21 8:24 questions regarding drivers/staging/iio/accel/sca3000_core.c Himangi Saraogi
@ 2014-07-27 16:24 ` Jonathan Cameron
0 siblings, 0 replies; 2+ messages in thread
From: Jonathan Cameron @ 2014-07-27 16:24 UTC (permalink / raw)
To: Himangi Saraogi, Greg Kroah-Hartman, linux-iio, devel,
linux-kernel
Cc: Julia Lawall
On 21/07/14 09:24, Himangi Saraogi wrote:
> Hi,
>
> I was looking at the possibility of using a managed interface for
> iio_device_register in sca3000_probe. But this will lead to the
> iio_device_unregister function being called after
> sca3000_unconfigure_ring in the remove function. I have a few
> queries:
>
> 1. Is it safe to move the unregister function over the
> sca3000_unconfigure_ring?
No, in fact it should be before various other things
(though it isn't currently). The device unregister
removes the userspace interfaces. Hence it should always
be called before anything else happens in a remove function.
>
> 2. Is it correct that on failure the probe function does not call
> sca3000_unconfigure_ring?
Nope. That's a bug. Actually the whole probe function ordering is
suspicious. The device register should probably be a lot later
(i.e. last). There might be some esoteric reason that isn't the case
but I honestly can't remember. Whilst I have one of these parts
the wire bodge needs repairing and I haven't fired the board it plugs
into up for a good while. If it wasn't such and interesting part I'd
be tempted to suggest dropping the driver entirely (and find out if
anyone else actually has one in the process!)
>
> 3. If it is fine moving unregister after sca3000_unconfigure_ring, I
> propose to add a devm counterpart of iio_buffer_unregister. Is it a
> good idea?
I'm not sure there enough users to bother and some of those should
probably use the triggered_buffer helper functions.
>
> Thanks, Himangi
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-07-27 16:22 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-21 8:24 questions regarding drivers/staging/iio/accel/sca3000_core.c Himangi Saraogi
2014-07-27 16:24 ` Jonathan Cameron
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).