Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp874646pxk; Thu, 17 Sep 2020 19:59:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxl7+NdBFcQ/w8YbEyNMAqGzBVqCPzSOXxvxBfOBmWt22fa2DzXBl+Oqe7BKlkhYnViwE7W X-Received: by 2002:aa7:c1c3:: with SMTP id d3mr36626869edp.228.1600397974067; Thu, 17 Sep 2020 19:59:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600397974; cv=none; d=google.com; s=arc-20160816; b=q/ui5ekgukAzjpFT8wnYGMA3sFiSvJUDoY64f47hC6RtiHj1mJfyzAlZwJw9f2D7ME fgZGK5ys2xiRLRa54pP6y5lrWOhYkDDpbfI7TKBL2vfhK5yxUjqryDDKb2kZHWtdPcUc tZ1yF3HJHVhOr/qmADk6h3CUyBEBQyusssmTT7mKtsQI8KiPwoLrsYtoP56rLqyiun3O cEAKM0wvoo6/uyx3SIXMreTy6vHxCxWdNEuWlh0rDi67QuaS2fXtwMlrqXE+JJDx5e0i SJP8N2288n0IbddkYUdj0msNgCScicGmyWLaAHXo7fuwfFxioaJ2FlCO2cNgLP7G4wdS 1jIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=oN8VG2yuDIdCteYG1FKWU0QDX92kzeLqqOl4H8jEhG8=; b=x6RkhYKYqdhH/aJkkQ5bcD0SR5itIDLKuoYFp7F91h5+XVWG6y4hs32g23UwY9YrX2 zA8fBRpYEYEFxIA0US60fHH/JSY6mCWFv7QQ+ETcEfQCh0g1hZe9HkKX2pDv19NFeDgd IBIu9ZQPZ3jmq47F8SK/zYqNvL3HyIkVBl7xdjjxvyFpXIWMXNc+5Xw6mzF5HcPIrRKb LV5QsWQul22CXZ2m1i+RL5xZyonCUj4kVuebgTZ5izVLWFV5aoxI0zaMJg4NtdTbEiwb F9q021If6zfeNO/U4kjrV/zjT7CGWG6QqO880lVJnAQ4/iMf+vOpW9OMbpwghhepW03B 5bSw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=zZILd6uG; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i14si1168822ejf.353.2020.09.17.19.59.10; Thu, 17 Sep 2020 19:59:34 -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; dkim=pass header.i=@kernel.org header.s=default header.b=zZILd6uG; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727948AbgIRC5R (ORCPT + 99 others); Thu, 17 Sep 2020 22:57:17 -0400 Received: from mail.kernel.org ([198.145.29.99]:55510 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727776AbgIRCGc (ORCPT ); Thu, 17 Sep 2020 22:06:32 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 68CFA239D0; Fri, 18 Sep 2020 02:06:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600394792; bh=6uzXXWI0y9hLLOPB61lhgPChBKZfo1sriuNCfxOGg8M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=zZILd6uGvqDSnCUffAjVLlgJtVqXYeXGFZgJ2f1lHbMSLxQZ1AM/u5GivZNeU+n4n 57sHNHFQDYAu84UV0Mn68hNgdLed9CpmIwV5MhFtGiNF7Kc6rpchIoA1E3DrWPZ2sE GJJaI9yvvDUQhz2uceuzn4h/xlMvVe8mEnwhQA7M= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Tang Bin , Zhang Shengju , Greg Kroah-Hartman , Sasha Levin , linux-usb@vger.kernel.org Subject: [PATCH AUTOSEL 5.4 262/330] USB: EHCI: ehci-mv: fix error handling in mv_ehci_probe() Date: Thu, 17 Sep 2020 22:00:02 -0400 Message-Id: <20200918020110.2063155-262-sashal@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200918020110.2063155-1-sashal@kernel.org> References: <20200918020110.2063155-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Tang Bin [ Upstream commit c856b4b0fdb5044bca4c0acf9a66f3b5cc01a37a ] 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 Link: https://lore.kernel.org/r/20200508114305.15740-1-tangbin@cmss.chinamobile.com Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- 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 66ec1fdf9fe7d..15b2e8910e9b7 100644 --- a/drivers/usb/host/ehci-mv.c +++ b/drivers/usb/host/ehci-mv.c @@ -157,9 +157,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.25.1