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

From: jeffy
Date: Wed Oct 18 2017 - 07:32:27 EST


Hi Rafael,

On 10/18/2017 07:11 PM, jeffy wrote:

my board has these devices:
spi master device->spi child device->spi based pwm->pwm_bl

and i add a device link to the pwm and pwm_bl, and got a warning about
the pwm not unbound:
sorry, it happens when i try to unbind the spi child device, and it's warning about the consumer(pwm_bl) not unbound.

static void device_links_purge(struct device *dev)
{
...
list_for_each_entry_safe_reverse(link, ln,
&dev->links.consumers, s_node) {
WARN_ON(link->status != DL_STATE_DORMANT &&
link->status != DL_STATE_NONE); <-- warning here!
__device_link_del(link);
}

and i've send a new patch to reorder the device_links_purge() and bus_remove_device, thanks again :)