linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] iio: Remove unused iio_device_put()
@ 2012-05-11 13:13 Lars-Peter Clausen
  2012-05-12 14:18 ` Greg Kroah-Hartman
  0 siblings, 1 reply; 5+ messages in thread
From: Lars-Peter Clausen @ 2012-05-11 13:13 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: Jonathan Cameron, devel, linux-iio, Lars-Peter Clausen

This function is currently unused and we do not have a matching iio_device_get()
function either, so just remove it.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Jonathan Cameron <jic23@kernel.org>
---
 include/linux/iio/iio.h |   10 ----------
 1 file changed, 10 deletions(-)

diff --git a/include/linux/iio/iio.h b/include/linux/iio/iio.h
index 6fdbdb8..eff2a39 100644
--- a/include/linux/iio/iio.h
+++ b/include/linux/iio/iio.h
@@ -412,16 +412,6 @@ int iio_push_event(struct iio_dev *indio_dev, u64 ev_code, s64 timestamp);
 
 extern struct bus_type iio_bus_type;
 
-/**
- * iio_device_put() - reference counted deallocation of struct device
- * @dev: the iio_device containing the device
- **/
-static inline void iio_device_put(struct iio_dev *indio_dev)
-{
-	if (indio_dev)
-		put_device(&indio_dev->dev);
-};
-
 /* Can we make this smaller? */
 #define IIO_ALIGN L1_CACHE_BYTES
 /**
-- 
1.7.10

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] iio: Remove unused iio_device_put()
  2012-05-11 13:13 [PATCH] iio: Remove unused iio_device_put() Lars-Peter Clausen
@ 2012-05-12 14:18 ` Greg Kroah-Hartman
  2012-05-12 14:24   ` Lars-Peter Clausen
  0 siblings, 1 reply; 5+ messages in thread
From: Greg Kroah-Hartman @ 2012-05-12 14:18 UTC (permalink / raw)
  To: Lars-Peter Clausen; +Cc: Jonathan Cameron, devel, linux-iio

On Fri, May 11, 2012 at 03:13:13PM +0200, Lars-Peter Clausen wrote:
> This function is currently unused and we do not have a matching iio_device_get()
> function either, so just remove it.
> 
> Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
> Acked-by: Jonathan Cameron <jic23@kernel.org>

No, I see a number of places it should be used.  Don't do "raw"
put_device() calls, every one of them could be making this call instead,
right?

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] iio: Remove unused iio_device_put()
  2012-05-12 14:18 ` Greg Kroah-Hartman
@ 2012-05-12 14:24   ` Lars-Peter Clausen
  2012-05-12 14:33     ` Greg Kroah-Hartman
  0 siblings, 1 reply; 5+ messages in thread
From: Lars-Peter Clausen @ 2012-05-12 14:24 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: Jonathan Cameron, devel, linux-iio

On 05/12/2012 04:18 PM, Greg Kroah-Hartman wrote:
> On Fri, May 11, 2012 at 03:13:13PM +0200, Lars-Peter Clausen wrote:
>> This function is currently unused and we do not have a matching iio_device_get()
>> function either, so just remove it.
>>
>> Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
>> Acked-by: Jonathan Cameron <jic23@kernel.org>
> 
> No, I see a number of places it should be used.  Don't do "raw"
> put_device() calls, every one of them could be making this call instead,
> right?

Hm, right in the new inkern code there are some put_device calls on
indio_dev.dev, I missed those, sorry. But we should really add a matching
iio_device_get() as well.

- Lars

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] iio: Remove unused iio_device_put()
  2012-05-12 14:24   ` Lars-Peter Clausen
@ 2012-05-12 14:33     ` Greg Kroah-Hartman
  2012-05-12 15:50       ` Jonathan Cameron
  0 siblings, 1 reply; 5+ messages in thread
From: Greg Kroah-Hartman @ 2012-05-12 14:33 UTC (permalink / raw)
  To: Lars-Peter Clausen; +Cc: Jonathan Cameron, devel, linux-iio

On Sat, May 12, 2012 at 04:24:22PM +0200, Lars-Peter Clausen wrote:
> On 05/12/2012 04:18 PM, Greg Kroah-Hartman wrote:
> > On Fri, May 11, 2012 at 03:13:13PM +0200, Lars-Peter Clausen wrote:
> >> This function is currently unused and we do not have a matching iio_device_get()
> >> function either, so just remove it.
> >>
> >> Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
> >> Acked-by: Jonathan Cameron <jic23@kernel.org>
> > 
> > No, I see a number of places it should be used.  Don't do "raw"
> > put_device() calls, every one of them could be making this call instead,
> > right?
> 
> Hm, right in the new inkern code there are some put_device calls on
> indio_dev.dev, I missed those, sorry. But we should really add a matching
> iio_device_get() as well.

I agree, and then fix up the inkern.c calls to call that as well :)

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] iio: Remove unused iio_device_put()
  2012-05-12 14:33     ` Greg Kroah-Hartman
@ 2012-05-12 15:50       ` Jonathan Cameron
  0 siblings, 0 replies; 5+ messages in thread
From: Jonathan Cameron @ 2012-05-12 15:50 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: Lars-Peter Clausen, Jonathan Cameron, devel, linux-iio

On 05/12/2012 03:33 PM, Greg Kroah-Hartman wrote:
> On Sat, May 12, 2012 at 04:24:22PM +0200, Lars-Peter Clausen wrote:
>> On 05/12/2012 04:18 PM, Greg Kroah-Hartman wrote:
>>> On Fri, May 11, 2012 at 03:13:13PM +0200, Lars-Peter Clausen wrote:
>>>> This function is currently unused and we do not have a matching iio_device_get()
>>>> function either, so just remove it.
>>>>
>>>> Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
>>>> Acked-by: Jonathan Cameron <jic23@kernel.org>
>>>
>>> No, I see a number of places it should be used.  Don't do "raw"
>>> put_device() calls, every one of them could be making this call instead,
>>> right?
>>
>> Hm, right in the new inkern code there are some put_device calls on
>> indio_dev.dev, I missed those, sorry. But we should really add a matching
>> iio_device_get() as well.
> 
> I agree, and then fix up the inkern.c calls to call that as well :)
> 
> thanks,
> 
> greg k-h
Got to love code evolution and the mess it can leave.  Thanks for
picking up on this Greg.  I'd completely forgotten those were there
when I reviewed it..

Agreed that we want a pair of wrappers and assuming Lars-Peter
will add them if I don't hear anything else :)

Jonathan

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2012-05-12 15:50 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-11 13:13 [PATCH] iio: Remove unused iio_device_put() Lars-Peter Clausen
2012-05-12 14:18 ` Greg Kroah-Hartman
2012-05-12 14:24   ` Lars-Peter Clausen
2012-05-12 14:33     ` Greg Kroah-Hartman
2012-05-12 15:50       ` 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).