Re: [PATCH] driver core: Make sure device detached from driver before deleting it

From: jeffy
Date: Wed Oct 18 2017 - 03:07:15 EST


Hi Greg,

Thanks for your reply.

On 10/18/2017 02:19 PM, Greg Kroah-Hartman wrote:
On Wed, Oct 18, 2017 at 01:49:26PM +0800, Jeffy Chen wrote:
>There are cases we call device_del() without detaching it from the
>driver(e.g. spi core del children devices).
Why would you do that? Shouldn't that be fixed instead of this odd
work-around for a broken bus?

i was thinking since the device_unregister() is called everywhere, maybe there are some other drivers missing that too?

and the driver calls device_add(), then the core attaches the device to the driver automatically, maybe it would make sense to let the core automatic detach it somehow...

but i know nothing about driver core, maybe i should fix it in spi core, i'll send new patch for that :)

thanks,

greg k-h