public inbox for linux-i2c@vger.kernel.org
 help / color / mirror / Atom feed
* [Q] i2c_new_device vs i2c_del_driver
@ 2009-03-17 17:24 Guennadi Liakhovetski
       [not found] ` <Pine.LNX.4.64.0903171710350.5318-0199iw4Nj15frtckUFj5Ag@public.gmane.org>
  0 siblings, 1 reply; 6+ messages in thread
From: Guennadi Liakhovetski @ 2009-03-17 17:24 UTC (permalink / raw)
  To: linux-i2c-u79uwXL29TY76Z2rM5mHXA

Hi,

I have a question regarding dynimically created i2c devices. If I have a 
card with an i2c device on it. Once I load a driver for that card, it uses 
its knowledge of the hardware and registers a new i2c device using 
i2c_new_device. Then at some point a driver for that i2c device is loaded, 
it calls i2c_add_driver, then its probe() method is called with the 
dynamically created device. So far so good. Now I unload the i2c driver, 
it calls i2c_del_driver(), and then, IIUC, __detach_adapter will be called 
for all devices attached to this driver, including our device from above, 
then i2c_unregister_device will be called for it, a comment to which says

"reverse effect of i2c_new_device()"

So, our newly created device is gone, and loading the i2c driver again 
will not find it any more?... This doesn't seem to be the case, so, I 
think, the comment is wrong and has to be fixed.

Thanks
Guennadi
---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer

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

end of thread, other threads:[~2009-03-20 17:48 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-03-17 17:24 [Q] i2c_new_device vs i2c_del_driver Guennadi Liakhovetski
     [not found] ` <Pine.LNX.4.64.0903171710350.5318-0199iw4Nj15frtckUFj5Ag@public.gmane.org>
2009-03-17 17:38   ` Jean Delvare
     [not found]     ` <20090317183809.55320908-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org>
2009-03-17 17:50       ` Guennadi Liakhovetski
     [not found]         ` <Pine.LNX.4.64.0903171849060.5318-0199iw4Nj15frtckUFj5Ag@public.gmane.org>
2009-03-17 18:17           ` Jean Delvare
     [not found]             ` <20090317191724.7ace956f-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org>
2009-03-17 18:29               ` Guennadi Liakhovetski
     [not found]                 ` <Pine.LNX.4.64.0903171923230.5318-0199iw4Nj15frtckUFj5Ag@public.gmane.org>
2009-03-20 17:48                   ` Jean Delvare

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox