Re: [PATCH/RFC] Call platform_notify_remove later

From: Benjamin Herrenschmidt
Date: Wed Oct 18 2006 - 04:56:38 EST


On Wed, 2006-10-18 at 03:34 -0400, Len Brown wrote:
> On Tuesday 17 October 2006 22:08, Benjamin Herrenschmidt wrote:
> > (CC'ed Deepak and Len, the two only users of that callback I could find
> > in the tree).
> >
> > Right now, the driver core calls the platform_notify hook when adding a
> > device, before attaching to the bus and probing drivers. That is all
> > good. However, it calls platform_notify_remove on removal of a device
> > also -before- calling bus_remove_device(), and thus before unhooking
> > drivers from that device. That strikes me as odd, and even incorrect.
>
> AFAICS, your change is logical and should be fine.

Thanks. However, before I throw it properly at Andrew for 2.6.20, what
do you think of a different approach: removing those 2 function pointers
and replacing them with a notifier ?

I find that with my refactoring of the DMA ops, I actually have various
bits of code (the pci layer, some platform bus code, etc...) that need
to "hook" there to create my auxilliary data structure depending, among
other, on the bus type, and I'd like to keep those functions well
separated in different files without inter-links.

Thus I'd rather have the interested bits be able to just register a
notifier and get called on device add and remove. Does it look like
something you could use too ?

Cheers,
Ben.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/