Commit 4c80b95c authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] Fix oops with CONFIG_MCA=y

With CONFIG_MCA=y and no MCA bus present, drivers go oops deep in the kobject
code when calling mca_register_driver().  Because there is no MCA subsystem
registered against the driver.

Plug this in mca_register_driver().
parent 0090fbee
......@@ -32,9 +32,11 @@ int mca_register_driver(struct mca_driver *mca_drv)
{
int r;
if (MCA_bus) {
mca_drv->driver.bus = &mca_bus_type;
if ((r = driver_register(&mca_drv->driver)) < 0)
return r;
}
return 0;
}
......@@ -42,6 +44,7 @@ EXPORT_SYMBOL(mca_register_driver);
void mca_unregister_driver(struct mca_driver *mca_drv)
{
if (MCA_bus)
driver_unregister(&mca_drv->driver);
}
EXPORT_SYMBOL(mca_unregister_driver);
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment