Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752739AbcCTRIt (ORCPT ); Sun, 20 Mar 2016 13:08:49 -0400 Received: from thejh.net ([37.221.195.125]:33751 "EHLO thejh.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751249AbcCTRIs (ORCPT ); Sun, 20 Mar 2016 13:08:48 -0400 From: Jann Horn To: Greg Kroah-Hartman , Sudip Mukherjee Cc: linux-kernel@vger.kernel.org Subject: [PATCH] drivers: fix link order Date: Sun, 20 Mar 2016 18:08:30 +0100 Message-Id: <1458493710-4299-1-git-send-email-jann@thejh.net> X-Mailer: git-send-email 2.1.4 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1561 Lines: 43 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 --- 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