Received: by 2002:a25:23cc:0:0:0:0:0 with SMTP id j195csp1575240ybj; Fri, 8 May 2020 04:44:41 -0700 (PDT) X-Google-Smtp-Source: APiQypJ6fDGcQ026zkHKz47TNylwxMZ+y1vvKvdRrouAupmuikZwbbBRPiC8AyIM5MSsjV1ZaStF X-Received: by 2002:a17:906:6b05:: with SMTP id q5mr1459187ejr.329.1588938281188; Fri, 08 May 2020 04:44:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588938281; cv=none; d=google.com; s=arc-20160816; b=arhiCSIdEec6Wm+UkhOswcwgOc5/ClyVgSy/t+7cr7oCEb7DeQCEEpnq96lXHM2wJz 87NC346MZVu2qq5xJQMkN/PaMppVaENDHfL7cWFAp7YkjY5k7SMnRew/2QFLy3r1RVho yn0ird4zexWF3P53YEspH1+UZYFa7/APKZS8whQOG1JJsaKSApdTPv4KSzYh3rO0E8mX XUg98shUfvAY/7G6wlJn0olN8RGcBDjQAPsNwRIuJPLyiZQoUY5rgXoivqS7iMjm15Kl LWmu5ky0V4LHHBf0WBBLHbkfr+zbtoEkI1zzLFu9KCeJD4bh4Q7UQs4mEvOUzgIeDRaa C1BQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=o/M9i7f3f7ER6AX2vKGCZb/50UlnSsnbJlZKwvUeZq0=; b=UcUo+9/lEnfvKHF/8LcLm0fWgFAbWtT0HDpiAus/byecYV7O4XRbZLp2aPT0xU5Xcj cBENhsW0kyqIu+V66IV7VgXC5jav50wR4JtNsviVGM9oktJCywpxtowNfJ2D4a87pHlX /qynIyEsVNO5fxY6gOQoMdzKQHm+CIuA2Z+0odv5Agnj+ExOXCApDsRvlnDS6OkrT/9k tba/ysYwa7qx12m82KOb4UXUvMjF9AUxul5jkVnB3XiqnSq4SFz3El7j01hRwQ/gePJP bssylM/MqigeG/Qh3yy9JMmTA0QOiIDXTSVjLpNn8NmuGAUiKcXUn8dmQ1NwM3Ieodl3 N1Qw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t8si809803edi.350.2020.05.08.04.44.17; Fri, 08 May 2020 04:44:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726817AbgEHLmx (ORCPT + 99 others); Fri, 8 May 2020 07:42:53 -0400 Received: from cmccmta1.chinamobile.com ([221.176.66.79]:4390 "EHLO cmccmta1.chinamobile.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726616AbgEHLmx (ORCPT ); Fri, 8 May 2020 07:42:53 -0400 Received: from spf.mail.chinamobile.com (unknown[172.16.121.11]) by rmmx-syy-dmz-app02-12002 (RichMail) with SMTP id 2ee25eb545a8f18-5941c; Fri, 08 May 2020 19:42:32 +0800 (CST) X-RM-TRANSID: 2ee25eb545a8f18-5941c X-RM-TagInfo: emlType=0 X-RM-SPAM-FLAG: 00000000 Received: from localhost.localdomain (unknown[112.25.154.146]) by rmsmtp-syy-appsvr06-12006 (RichMail) with SMTP id 2ee65eb545a4a75-390f4; Fri, 08 May 2020 19:42:32 +0800 (CST) X-RM-TRANSID: 2ee65eb545a4a75-390f4 From: Tang Bin To: stern@rowland.harvard.edu, gregkh@linuxfoundation.org Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, Tang Bin , Zhang Shengju Subject: [PATCH] USB: EHCI: ehci-mv: fix error handling in mv_ehci_probe() Date: Fri, 8 May 2020 19:43:05 +0800 Message-Id: <20200508114305.15740-1-tangbin@cmss.chinamobile.com> X-Mailer: git-send-email 2.20.1.windows.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org If the function platform_get_irq() failed, the negative value returned will not be detected here. So fix error handling in mv_ehci_probe(). And when get irq failed, the function platform_get_irq() logs an error message, so remove redundant message here. Signed-off-by: Zhang Shengju Signed-off-by: Tang Bin --- drivers/usb/host/ehci-mv.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/usb/host/ehci-mv.c b/drivers/usb/host/ehci-mv.c index 1c079953e..b2da62bfd 100644 --- a/drivers/usb/host/ehci-mv.c +++ b/drivers/usb/host/ehci-mv.c @@ -166,9 +166,8 @@ static int mv_ehci_probe(struct platform_device *pdev) hcd->regs = ehci_mv->op_regs; hcd->irq = platform_get_irq(pdev, 0); - if (!hcd->irq) { - dev_err(&pdev->dev, "Cannot get irq."); - retval = -ENODEV; + if (hcd->irq < 0) { + retval = hcd->irq; goto err_disable_clk; } -- 2.20.1.windows.1