From patchwork Thu Oct 21 19:14:31 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Shtylyov X-Patchwork-Id: 12576305 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7A83FC4332F for ; Thu, 21 Oct 2021 19:14:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5C86660F0F for ; Thu, 21 Oct 2021 19:14:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231764AbhJUTRA (ORCPT ); Thu, 21 Oct 2021 15:17:00 -0400 Received: from mxout01.lancloud.ru ([45.84.86.81]:52538 "EHLO mxout01.lancloud.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231424AbhJUTQ6 (ORCPT ); Thu, 21 Oct 2021 15:16:58 -0400 Received: from LanCloud DKIM-Filter: OpenDKIM Filter v2.11.0 mxout01.lancloud.ru 564F220CDA53 Received: from LanCloud Received: from LanCloud Received: from LanCloud From: Sergey Shtylyov To: , Greg Kroah-Hartman , Alan Stern CC: Nicolas Ferre , Alexandre Belloni , Ludovic Desroches , Subject: [PATCH 04/10] usb: host: ehci-atmel: fix deferred probing Date: Thu, 21 Oct 2021 22:14:31 +0300 Message-ID: <20211021191437.8737-5-s.shtylyov@omp.ru> X-Mailer: git-send-email 2.26.3 In-Reply-To: <20211021191437.8737-1-s.shtylyov@omp.ru> References: <20211021191437.8737-1-s.shtylyov@omp.ru> MIME-Version: 1.0 X-Originating-IP: [192.168.11.198] X-ClientProxiedBy: LFEXT02.lancloud.ru (fd00:f066::142) To LFEX1907.lancloud.ru (fd00:f066::207) Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org The driver overrides the error codes (and also IRQ0) returned by platform_get_irq() to -ENODEV, so if it returns -EPROBE_DEFER, the driver will fail the probe permanently instead of the deferred probing. Switch to propagating the error codes upstream -- that means we have to explicitly filter out IRQ0 as bad since usb_add_hcd() doesn't quite like it... :-) Fixes: 501c9c0802d9 ("USB: at91: Add USB EHCI driver for at91sam9g45 series") Signed-off-by: Sergey Shtylyov Acked-by: Alan Stern --- drivers/usb/host/ehci-atmel.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/usb/host/ehci-atmel.c b/drivers/usb/host/ehci-atmel.c index 05d41fd65f25..3f7c8ccc6d7f 100644 --- a/drivers/usb/host/ehci-atmel.c +++ b/drivers/usb/host/ehci-atmel.c @@ -104,8 +104,12 @@ static int ehci_atmel_drv_probe(struct platform_device *pdev) pr_debug("Initializing Atmel-SoC USB Host Controller\n"); irq = platform_get_irq(pdev, 0); - if (irq <= 0) { - retval = -ENODEV; + if (irq < 0) { + retval = irq; + goto fail_create_hcd; + } + if (!irq) { + retval = -EINVAL; goto fail_create_hcd; }