Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1361324

[PATCH] drivers: fix link order

From Jann Horn <jann@thejh.net>
Newsgroups linux.kernel
Subject [PATCH] drivers: fix link order
Date 2016-03-20 18:10 +0100
Message-ID <reP1v-1q8-13@gated-at.bofh.it> (permalink)
Organization linux.* mail to news gateway

Show all headers | View raw


Since commit e7223f186033 ("ppdev: use new parport device model"),
my machine panics on boot, caused by the BUG_ON(!drv->bus->p) in
drivers/base/driver.c, called via
ppdev_init() -> parport_register_driver().

The problem is that parport_bus_init(), which initializes
parport_bus_type.p, is only called in an __init method in
drivers/parport/procfs.c, which has not been called yet at the time
ppdev_init(), an __init method in drivers/char/ppdev.c, is called
if the latter is compiled into the kernel (and not a module).

Let's hope this change doesn't break any other stuff? It
works for me.

Signed-off-by: Jann Horn <jann@thejh.net>
---
 drivers/Makefile | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/Makefile b/drivers/Makefile
index 8f5d076..68bc38f 100644
--- a/drivers/Makefile
+++ b/drivers/Makefile
@@ -45,6 +45,9 @@ obj-$(CONFIG_REGULATOR)		+= regulator/
 # reset controllers early, since gpu drivers might rely on them to initialize
 obj-$(CONFIG_RESET_CONTROLLER)	+= reset/
 
+# parport/ before char/ because ppdev_init() depends on parport_bus_init()
+obj-$(CONFIG_PARPORT)		+= parport/
+
 # tty/ comes before char/ so that the VT console is the boot-time
 # default.
 obj-y				+= tty/
@@ -62,7 +65,6 @@ obj-$(CONFIG_CONNECTOR)		+= connector/
 obj-$(CONFIG_FB_I810)           += video/fbdev/i810/
 obj-$(CONFIG_FB_INTEL)          += video/fbdev/intelfb/
 
-obj-$(CONFIG_PARPORT)		+= parport/
 obj-$(CONFIG_NVM)		+= lightnvm/
 obj-y				+= base/ block/ misc/ mfd/ nfc/
 obj-$(CONFIG_LIBNVDIMM)		+= nvdimm/
-- 
2.1.4

Back to linux.kernel | Previous | Next | Find similar | Unroll thread


Thread

[PATCH] drivers: fix link order Jann Horn <jann@thejh.net> - 2016-03-20 18:10 +0100

csiph-web