From patchwork Wed Aug 26 12:28:28 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Holler X-Patchwork-Id: 7076711 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id EA7179F344 for ; Wed, 26 Aug 2015 12:34:32 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2F08720939 for ; Wed, 26 Aug 2015 12:34:32 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 403B520835 for ; Wed, 26 Aug 2015 12:34:31 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZUZsM-0001q4-W3; Wed, 26 Aug 2015 12:32:23 +0000 Received: from h1446028.stratoserver.net ([85.214.92.142] helo=mail.ahsoftware.de) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZUZs9-0001B0-8M for linux-arm-kernel@lists.infradead.org; Wed, 26 Aug 2015 12:32:10 +0000 Received: by mail.ahsoftware.de (Postfix, from userid 65534) id 409B72C9C3B3; Wed, 26 Aug 2015 14:31:51 +0200 (CEST) Received: from wandq.ahsoftware (p4FC3641D.dip0.t-ipconnect.de [79.195.100.29]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.ahsoftware.de (Postfix) with ESMTPSA id 74C892C9C3A8 for ; Wed, 26 Aug 2015 14:31:48 +0200 (CEST) Received: by wandq.ahsoftware (Postfix, from userid 65534) id C903B9A54E7; Wed, 26 Aug 2015 14:31:47 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-5.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from krabat.ahsoftware (unknown [192.168.207.2]) by wandq.ahsoftware (Postfix) with ESMTP id 60BF59A53E5; Wed, 26 Aug 2015 12:29:05 +0000 (UTC) From: Alexander Holler To: linux-kernel@vger.kernel.org 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> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150826_053209_490563_EB298679 X-CRM114-Status: GOOD ( 14.59 ) X-Spam-Score: -1.9 (-) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, Russel King , Tomeu Vizoso , Greg KH , Kishon Vijay Abraham I , Grant Likely , Alexander Holler , Andrew Morton , linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP 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) {