aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/nubus.h
diff options
context:
space:
mode:
authorFinn Thain <fthain@telegraphics.com.au>2018-05-09 11:04:48 +1000
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-05-14 16:27:08 +0200
commitbdeeed098811b36d1f988521600a89a400830a4b (patch)
tree7447eae93d4e230c85f70eee6ea57c95f3566784 /include/linux/nubus.h
parentARM: amba: Fix wrong indentation in driver_override_store() (diff)
downloadlinux-dev-bdeeed098811b36d1f988521600a89a400830a4b.tar.xz
linux-dev-bdeeed098811b36d1f988521600a89a400830a4b.zip
nubus: Call bus_register unconditionally
Loading a NuBus driver module on a non-NuBus machine triggers the BUG_ON(!drv->bus->p) in driver_register(), because bus_register() was not called, because it is conditional on MACH_IS_MAC. Fix the crash by calling bus_register() unconditionally. Call it from a postcore_initcall(), like other busses do. Hence, the bus type is available for device_register(), which happens in a subsys initcall, and for driver_register(), which happens in a device or module initcall. Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Reported-by: Michael Schmitz <schmitzmic@gmail.com> Tested-by: Stan Johnson <userm57@yahoo.com> Fixes: 7f86c765a6a2 ("nubus: Add support for the driver model") Signed-off-by: Finn Thain <fthain@telegraphics.com.au> Reviewed-by: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include/linux/nubus.h')
-rw-r--r--include/linux/nubus.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/linux/nubus.h b/include/linux/nubus.h
index 6e8200215321..eba50b057f6f 100644
--- a/include/linux/nubus.h
+++ b/include/linux/nubus.h
@@ -163,7 +163,7 @@ void nubus_seq_write_rsrc_mem(struct seq_file *m,
unsigned char *nubus_dirptr(const struct nubus_dirent *nd);
/* Declarations relating to driver model objects */
-int nubus_bus_register(void);
+int nubus_parent_device_register(void);
int nubus_device_register(struct nubus_board *board);
int nubus_driver_register(struct nubus_driver *ndrv);
void nubus_driver_unregister(struct nubus_driver *ndrv);