Re: [PATCH] usb: core: Call disconnect() only if it is provided by driver

From: Oliver Neukum
Date: Thu May 19 2022 - 10:12:24 EST




On 19.05.22 15:29, Dmytro Bagrii wrote:
> A driver may use devres allocations. Disconnect handler is not needed in
> this case. Allow such driver to leave .disconnect field uninitialized in
> struct usb_driver instead of providing empty stub function.
It is needed. disconnect() means that you have to give up
ownership of the interface and must cease IO. That cannot
be done with devres.
I am pretty sure that a driver without disconnect() is buggy.
disconnect() is the one method that is really not optional.

    Regards
        Oliver