Re: [PATCH 1/9] staging: comedi: avoid a put_device(), get_device() sequence

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2012-10-22 20:40, Greg Kroah-Hartman wrote:
On Mon, Oct 15, 2012 at 01:07:31PM +0100, Ian Abbott wrote:
In `comedi_set_hw_dev()`, if there is no change to `dev->hw_dev` (and it
is not `NULL`), don't bother putting and getting the device.

Why would any code call comedi_set_hw_dev() in such a situation?

I'll take this patch, but is it really needed?

There are some left-over calls to comedi_set_hw_dev() in the drivers that could be eliminated once they adopt the new auto_attach hook. Once the left-overs have been removed, this change wouldn't be needed.

Maybe it would be better to just change comedi_set_hw_dev() so it gets the new device _before_ putting the old device in order to avoid any possibility of triggering some kref_release routine prematurely when the new device and old device are the same.

--
-=( Ian Abbott @ MEV Ltd.    E-mail: <abbotti@xxxxxxxxx>        )=-
-=( Tel: +44 (0)161 477 1898   FAX: +44 (0)161 718 3587         )=-
_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/devel


[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux