Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3484132imu; Sun, 11 Nov 2018 16:08:49 -0800 (PST) X-Google-Smtp-Source: AJdET5enXkMfPmTxfBImwqKQFV5z1Obte1Kc81RWorvZ0qT7ms1yZmE20U80/C5VcyLl6isTCX58 X-Received: by 2002:a17:902:4523:: with SMTP id m32-v6mr16784728pld.276.1541981329090; Sun, 11 Nov 2018 16:08:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541981329; cv=none; d=google.com; s=arc-20160816; b=HAN6w0umfHetRmXvF/Z/07S+7EO2vBIPLPtOAOeUN2OIH4ITioxEnBI+yzwajiudhK ylPMJC0p+UNQgSnf98HEMTqUti3MyKdZFrQ+AWGptE2CzFoAH3t0PSgGPLXMPoeqBv/e VJjWMhPAZOJqNCljmSxd7BC+UbstZBzXmS9sPBxBv2XCFTZ8anMJ0IpujQCMUp5ripsV vj5/IEGJtQPsZlVbDVfzSi3AJDQ1MwSfy0dFP/GS82Giz4NDAplafUe5mhA0tf9QJnO1 8lLjDIEHiks30L/A1yfJojiEbJ8Li1thzKfn4ZZDpZaJpFgV5bDXAQqtu4k9E1O5FRVi brYw== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=vvtxYDk4odzYs4WqXyJLjgOIAF7XGVqF4g33QjAz7k8=; b=Bb6qP/bh4s+mhXalRtduMk8TfJX+a3rMIefvO+RsLXeQir4F4I5z0JCp6VdmYuKL8P gDp2ldm5TqhdyOhg4mi+p1d4p75Y03UC1117nVN+5Fl/ZMufq53b9Pmt8m4FHgxio1CX 8MhXKkWDr2PO4xAWZOnA+uV5sZYSGl1vyHBzqM8EiPBluB9lcDxdi0PVcC/G8dJv3+Gv HmG9hYHKEdylDGuiJMp6DHvqPymZ0Db+P8lrSJmmlIX7x7D3qTrZFao+IGzfIdrD9Wfx o4geWjIp+TYO6ccnbA2bpqjrTNAusJ7M1aq0LxREKvEdDgHDT401fC8OEiy0JFSns5C8 gqMw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=L957PIeK; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t3-v6si16675318pfa.170.2018.11.11.16.08.34; Sun, 11 Nov 2018 16:08:49 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=L957PIeK; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732035AbeKLJ53 (ORCPT + 99 others); Mon, 12 Nov 2018 04:57:29 -0500 Received: from mail.kernel.org ([198.145.29.99]:60706 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731746AbeKLIRh (ORCPT ); Mon, 12 Nov 2018 03:17:37 -0500 Received: from localhost (unknown [206.108.79.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id C714221582; Sun, 11 Nov 2018 22:27:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541975261; bh=OCE2gfoVX0OPHrlJw8Zwl3HmIOIo0l8PDPSm4Nx/Xnw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=L957PIeK0j9CQz47tD1w9qkE/aaNZErnyHbhIDy6XZTZaCQ1JN8uGkCJhBG2DM+m4 sKbLlNS3PR6xQ2ByXc9CS/wogQ01qEbyNcVoQpp9MfvzQpkKtoFGyn9LhJRt/R/3XV yfpZBYOJiyCSPa2+WXkBnOV9T2//HrwouyyG3Ing= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Tudor Ambarus , Nicolas Ferre , Sasha Levin Subject: [PATCH 4.19 147/361] usb: host: ohci-at91: fix request of irq for optional gpio Date: Sun, 11 Nov 2018 14:18:14 -0800 Message-Id: <20181111221641.054322017@linuxfoundation.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181111221619.915519183@linuxfoundation.org> References: <20181111221619.915519183@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.19-stable review patch. If anyone has any objections, please let me know. ------------------ From: "Tudor.Ambarus@microchip.com" [ Upstream commit 325b9313ec3be56c8e2fe03f977fee19cec75820 ] atmel,oc-gpio is optional. Request its irq only when atmel,oc is set in device tree. devm_gpiod_get_index_optional returns NULL if -ENOENT. Check its return value for NULL before error, because it is more probable that atmel,oc is not set. This fixes the following errors on boards where atmel,oc is not set in device tree: [ 0.960000] at91_ohci 500000.ohci: failed to request gpio "overcurrent" IRQ [ 0.960000] at91_ohci 500000.ohci: failed to request gpio "overcurrent" IRQ [ 0.970000] at91_ohci 500000.ohci: failed to request gpio "overcurrent" IRQ Signed-off-by: Tudor Ambarus Acked-by: Nicolas Ferre Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/usb/host/ohci-at91.c | 2 ++ 1 file changed, 2 insertions(+) --- a/drivers/usb/host/ohci-at91.c +++ b/drivers/usb/host/ohci-at91.c @@ -551,6 +551,8 @@ static int ohci_hcd_at91_drv_probe(struc pdata->overcurrent_pin[i] = devm_gpiod_get_index_optional(&pdev->dev, "atmel,oc", i, GPIOD_IN); + if (!pdata->overcurrent_pin[i]) + continue; if (IS_ERR(pdata->overcurrent_pin[i])) { err = PTR_ERR(pdata->overcurrent_pin[i]); dev_err(&pdev->dev, "unable to claim gpio \"overcurrent\": %d\n", err);