Re: [PATCH] driver core: Make sure device detached from driver before deleting it
From: Rafael J. Wysocki
Date: Wed Oct 18 2017 - 07:43:11 EST
On Wednesday, October 18, 2017 1:32:15 PM CEST jeffy wrote:
> 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 :)
Which I'm not sure is the right approach just yet.
I'll follow up in the patch thread in any case.
Thanks,
Rafael