Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933251AbbHZMb6 (ORCPT ); Wed, 26 Aug 2015 08:31:58 -0400 Received: from h1446028.stratoserver.net ([85.214.92.142]:41061 "EHLO mail.ahsoftware.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932614AbbHZMby (ORCPT ); Wed, 26 Aug 2015 08:31:54 -0400 From: Alexander Holler To: linux-kernel@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, Greg KH , Russel King , Andrew Morton , Grant Likely , Tomeu Vizoso , Alexander Holler , Kishon Vijay Abraham I Subject: [PATCH 16/16] phy: phy-core: fix initcall level Date: Wed, 26 Aug 2015 14:28:28 +0200 Message-Id: <1440592108-3740-17-git-send-email-holler@ahsoftware.de> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1440592108-3740-1-git-send-email-holler@ahsoftware.de> References: <1440592108-3740-1-git-send-email-holler@ahsoftware.de> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1349 Lines: 39 The phy-core has to be initialized before other dependent usb-drivers, otherwise a crash might occur. Currently phy_core_init() is called in the initcall-level device, which is the same level where most usb-drivers will end up. By luck this seemed to have been called most of the time before other usb-drivers without having been explicitly enforced. But if phy_core_init() is not called before a dependent driver, a null-pointer exception might occur (e.g. because the phy device class isn't registered). To fix this, phy_core_init() is moved to the initcall-level fs (right before the standard initcall level device). Signed-off-by: Alexander Holler --- drivers/phy/phy-core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/phy/phy-core.c b/drivers/phy/phy-core.c index fc48fac..4945029 100644 --- a/drivers/phy/phy-core.c +++ b/drivers/phy/phy-core.c @@ -930,7 +930,7 @@ static int __init phy_core_init(void) return 0; } -module_init(phy_core_init); +fs_initcall_sync(phy_core_init); static void __exit phy_core_exit(void) { -- 2.1.0 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/