From patchwork Tue Sep 11 15:06:08 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 10595791 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C4F1F13B8 for ; Tue, 11 Sep 2018 15:06:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B29082945B for ; Tue, 11 Sep 2018 15:06:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A6C0B2974C; Tue, 11 Sep 2018 15:06:06 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 428002945B for ; Tue, 11 Sep 2018 15:06:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727002AbeIKUFq (ORCPT ); Tue, 11 Sep 2018 16:05:46 -0400 Received: from perceval.ideasonboard.com ([213.167.242.64]:39734 "EHLO perceval.ideasonboard.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726909AbeIKUFq (ORCPT ); Tue, 11 Sep 2018 16:05:46 -0400 Received: from avalon.bb.dnainternet.fi (dfj612ybrt5fhg77mgycy-3.rev.dnainternet.fi [IPv6:2001:14ba:21f5:5b00:2e86:4862:ef6a:2804]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 664741A91; Tue, 11 Sep 2018 17:06:02 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1536678362; bh=ALeSwjFGcmLDO8ZCQ4m95V2yiFz+vAZ7B5JxM75TxW0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DE778KloubfzjPMWp9iR+Etha7V/+B0B9ESKaSYYZfyq+CUh+aDVlwqed9ya7VcRr C/D1oF91Xxz6oPFREiNO8ZLcbuk2N4PwKelT9LgkxUKeKs96qwlwJhgsURjVcxg9Lc 83AJcG+BRYVvGvl0TpC6qmpul0vC7qc/C8Lc4qWU= From: Laurent Pinchart To: linux-usb@vger.kernel.org, linux-omap@vger.kernel.org Cc: Tony Lindgren , Roger Quadros , Lee Jones , Tomi Valkeinen Subject: [PATCH 1/3] mfd: omap-usb-host: Use regular platform device probe mechanism Date: Tue, 11 Sep 2018 18:06:08 +0300 Message-Id: <20180911150610.27510-2-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20180911150610.27510-1-laurent.pinchart@ideasonboard.com> References: <20180911150610.27510-1-laurent.pinchart@ideasonboard.com> Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The omap-usb-host driver uses platform_driver_probe() in the fs initcall level to ensure that the devices get probed before the EHCI and OHCI drivers arer probed. The EHCI and OHCI devices are created and registered by the omap-usb-host driver, and if no driver is present yet to handle them they will patiently wait for they turn without any adverse effect. This mechanism is thus not needed, remove it. This fixes a bug that prevents EHCI and OHCI devices from being probed on the Pandaboard since commit 84badc5ec5fc ("ARM: dts: omap4: Move l4 child devices to probe them with ti-sysc"), as then omap-usb-host devices are now registered after the omap-usb-host driver initializes, and thus fail to probe due to platform_driver_probe() not finding any device. Fixes: 84badc5ec5fc ("ARM: dts: omap4: Move l4 child devices to probe them with ti-sysc") Signed-off-by: Laurent Pinchart --- drivers/mfd/omap-usb-host.c | 24 ++++-------------------- 1 file changed, 4 insertions(+), 20 deletions(-) diff --git a/drivers/mfd/omap-usb-host.c b/drivers/mfd/omap-usb-host.c index e11ab12fbdf2..b731026541f5 100644 --- a/drivers/mfd/omap-usb-host.c +++ b/drivers/mfd/omap-usb-host.c @@ -548,6 +548,7 @@ static int usbhs_omap_probe(struct platform_device *pdev) int i; bool need_logic_fck; + dev_info(&pdev->dev, "%s\n", __func__); if (dev->of_node) { /* For DT boot we populate platform data from OF node */ pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL); @@ -855,31 +856,14 @@ static struct platform_driver usbhs_omap_driver = { .pm = &usbhsomap_dev_pm_ops, .of_match_table = usbhs_omap_dt_ids, }, + .probe = usbhs_omap_probe, .remove = usbhs_omap_remove, }; +module_platform_driver(usbhs_omap_driver); + MODULE_AUTHOR("Keshava Munegowda "); MODULE_AUTHOR("Roger Quadros "); MODULE_ALIAS("platform:" USBHS_DRIVER_NAME); MODULE_LICENSE("GPL v2"); MODULE_DESCRIPTION("usb host common core driver for omap EHCI and OHCI"); - -static int __init omap_usbhs_drvinit(void) -{ - return platform_driver_probe(&usbhs_omap_driver, usbhs_omap_probe); -} - -/* - * init before ehci and ohci drivers; - * The usbhs core driver should be initialized much before - * the omap ehci and ohci probe functions are called. - * This usbhs core driver should be initialized after - * usb tll driver - */ -fs_initcall_sync(omap_usbhs_drvinit); - -static void __exit omap_usbhs_drvexit(void) -{ - platform_driver_unregister(&usbhs_omap_driver); -} -module_exit(omap_usbhs_drvexit);