Re: [patch] PCI device matching fix

Patrick Mochel (mochel@osdl.org)
Thu, 6 Jun 2002 15:57:24 -0700 (PDT)


> Yes, you're basically right, whether you use the refcount in struct driver
> or the module use count doesn't make any difference. Except for one thing:
> You cannot call module_exit() when the module count is > 0. Since only
> then unregister_driver() is called, there's no way to get the use count to
> zero and thus unload the module. One could of course change the policy to
> call unregister_driver() not from module_exit(), but e.g. by
> "echo remove > /driversfs/../my_driver", but it's surely not that I'm
> suggesting this.

We can keep the same policy as modules now - keep the usage count at 0
when not in use. That way the module can unload at any time. module_exit()
calls driver_unregister(), which, down the line, calls the drivers'
remove() for each device attached to it.

That seems a lot cleaner than anything so far; we leverage the existing
module infrastructure as much as possible. I'll see about codifying the
concept in the next day or so and sending it out..

-pat

-
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/