On Sun, Mar 09, 2003 at 01:14:13PM -0500, Ben Collins wrote:
>
> So I added a new callback to the device stucture called remove. This
> callback is done when device_del is about to remove a device from the
> tree. I've used this internally to make sure I can walk the list of
> children myself, and also do some other cleanups.
But don't you really want to remove the children before you remove the
parent? If you do this patch, then the remove() function will have to
clean up the children first, right? Can we handle the core recursion
with the current locks properly?
Yes, for USB we still have a list of a device's children, as we need
them for various things, and the current driver model only has a parent
pointer, not a child pointer (which is good, as for USB we can have
multiple children). So in the function where we know a USB device is
disconnected, we walk our list of children and disconnect them in a
depth-first order. With this patch I don't see how it helps me push
code into the driver core.
Confused,
greg k-h
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
This archive was generated by hypermail 2b29 : Sat Mar 15 2003 - 22:00:20 EST