linux/drivers/nubus
Finn Thain bdeeed0988 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: 7f86c765a6 ("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>
2018-05-14 16:27:08 +02:00
..
bus.c nubus: Call bus_register unconditionally 2018-05-14 16:27:08 +02:00
Makefile nubus: Add support for the driver model 2018-01-16 16:47:29 +01:00
nubus.c nubus: Call bus_register unconditionally 2018-05-14 16:27:08 +02:00
proc.c nubus: Add support for the driver model 2018-01-16 16:47:29 +01:00