From patchwork Sat Jul 2 21:03:55 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Darren Stevens X-Patchwork-Id: 586754 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1530BC43334 for ; Sat, 2 Jul 2022 21:04:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229798AbiGBVET (ORCPT ); Sat, 2 Jul 2022 17:04:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60032 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229486AbiGBVES (ORCPT ); Sat, 2 Jul 2022 17:04:18 -0400 Received: from mout.kundenserver.de (mout.kundenserver.de [217.72.192.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E7FE4DE8F for ; Sat, 2 Jul 2022 14:04:14 -0700 (PDT) Received: from Cyrus.lan ([86.151.31.128]) by mrelayeu.kundenserver.de (mreue107 [212.227.15.179]) with ESMTPA (Nemesis) id 1Mqrjz-1nlpiW0UXx-00mqvZ; Sat, 02 Jul 2022 23:03:57 +0200 Date: Sat, 2 Jul 2022 22:03:55 +0100 From: Darren Stevens To: linuxppc-dev@lists.ozlabs.org, oss@buserror.net, chzigotzky@xenosoft.de, robh@kernel.org, stern@rowland.harvard.edu, linux-usb@vger.kernel.org Cc: shawnguo@kernel.org, leoyang.li@nxp.com Subject: [PATCH v3] drivers/usb/host/ehci-fsl: Fix interrupt setup in host mode. Message-ID: <20220702220355.63b36fb8@Cyrus.lan> X-Mailer: Claws Mail 3.13.2 (GTK+ 2.24.30; powerpc-unknown-linux-gnu) MIME-Version: 1.0 X-Provags-ID: V03:K1:7dP2sXcx+tU1+/TK79yzyTjl/O/pW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kernel.org In patch a1a2b7125e10 (Drop static setup of IRQ resource from DT core) we stopped platform_get_resource() from returning the IRQ, as all drivers were supposed to have switched to platform_get_irq() Unfortunately the Freescale EHCI driver in host mode got missed. Fix it. Fixes: a1a2b7125e10 (Drop static setup of IRQ resource from DT core) Reported-by: Christian Zigotzky Suggested-by: Rob Herring Signed-off-by: Darren Stevens --- v3 - Corrected resource allocation in fsl-mph-dr-of.c v2 - Fixed coding style, removed a couple of unneeded initializations, cc'd Layerscape maintainers. Tested on AmigaOne X5000/20 and X5000/40 Contains code by Rob Herring (in fsl-mph-dr-of.c) diff --git a/drivers/usb/host/ehci-fsl.c b/drivers/usb/host/ehci-fsl.c index 385be30..896c0d1 100644 --- a/drivers/usb/host/ehci-fsl.c +++ b/drivers/usb/host/ehci-fsl.c @@ -76,14 +76,9 @@ static int fsl_ehci_drv_probe(struct platform_device *pdev) return -ENODEV; } - res = platform_get_resource(pdev, IORESOURCE_IRQ, 0); - if (!res) { - dev_err(&pdev->dev, - "Found HC with no IRQ. Check %s setup!\n", - dev_name(&pdev->dev)); - return -ENODEV; - } - irq = res->start; + irq = platform_get_irq(pdev, 0); + if (irq < 0) + return irq; hcd = __usb_create_hcd(&fsl_ehci_hc_driver, pdev->dev.parent, &pdev->dev, dev_name(&pdev->dev), NULL); diff --git a/drivers/usb/host/fsl-mph-dr-of.c b/drivers/usb/host/fsl-mph-dr-of.c index 44a7e58..e5df175 100644 --- a/drivers/usb/host/fsl-mph-dr-of.c +++ b/drivers/usb/host/fsl-mph-dr-of.c @@ -112,6 +112,9 @@ static struct platform_device *fsl_usb2_device_register( goto error; } + pdev->dev.of_node = ofdev->dev.of_node; + pdev->dev.of_node_reused = true; + retval = platform_device_add(pdev); if (retval) goto error;