Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3435800imu; Sun, 11 Nov 2018 15:03:37 -0800 (PST) X-Google-Smtp-Source: AJdET5eW7cOlI2Qbp67oRxQoXcdZ/3QhCB+1kFqQHOGuW5JvAOL5DysFiYxzHUIInEUUX2I4iXs6 X-Received: by 2002:a65:448a:: with SMTP id l10mr5051019pgq.387.1541977417466; Sun, 11 Nov 2018 15:03:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541977417; cv=none; d=google.com; s=arc-20160816; b=q7wJhNVpRl5h36wo9pwSh6Pm7gQALvZcoMkiVEjyqQhgjcjXAAznz0rQljOwG++pd0 Qf9jDmBI98AnsPq+Fku2aGW82ha9aUqC3+bSeWMEaPgolPMzsLmKBhBBqhXjhXMrhQAg S8Slum7ZGemtXcNwBsBqlbho2fbS4h9dVRdmAntfaTnHh5Qg4IdcgFYrb41T4wa+R+5E 3t8ExQ3fne/5jgP31yJfd2EhNi4AHCElrYkAA1wM4ZnjgwJvH40KOBNfSUXF45IyNhBO WuPKR489w05wTI4GmH5ksFKP6ZE27oQbCYAaNsk6NIoeAPWRFyoaveLqHOTUqm7/qsiv a+vA== 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=k2d0C2T58gm29K2Mr9nHHiwKbZ3ITtmpIcXExfH4Noc=; b=VzKLlOpXyrLs3BpoKFdF5NtDZAPgvM5dW6vT3KmaVQzMURvQvh+OUPR8vNoYuJNLZv IEtPlhndS2uwEg2Pm+16ABdWqsgdvBs/I7+DtJeivQUYUy2w3YK4+UZCFMpsxpSiruu5 4XQTd89fwsxPhTq8t0rYv+acTwQ+OAkZqGPU0domBSOcXdunNvM13pkDVMlgr39FcL3+ DEo9RoQQtHt7CXmJ6tF3cFh5P3OM7Pw2Zqgdf8T5i3u3u3ZphtOQGnEV0VbR5+b/NNK2 HDvbIzb+tXyeLEhEYF++4Sf0NWBmMPsOl8v/X8RyUNsrbErvzq30kpg0REM/aOWK12pO d4jQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=klKYfO7D; 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 u8-v6si14501074pgl.59.2018.11.11.15.03.22; Sun, 11 Nov 2018 15:03:37 -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=klKYfO7D; 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 S2390273AbeKLIxJ (ORCPT + 99 others); Mon, 12 Nov 2018 03:53:09 -0500 Received: from mail.kernel.org ([198.145.29.99]:51248 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390571AbeKLIWZ (ORCPT ); Mon, 12 Nov 2018 03:22:25 -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 75F0D2241E; Sun, 11 Nov 2018 22:32:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541975548; bh=DLYcEQTaGcx65aYAKuvWMTIWRvE6sH7pfmjfHUPE6a0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=klKYfO7DVa3MdH6m73M5lJVf4I2wjYibhSeX+OUc1v57lXjmr0bIPnlD25HC+CiQc Guy35SoiQVodEpZ8Vi4Q7ecLFfZ9+RolLbXjG4EsXh7kNJ2Bww+WD9QNR3Okjw5SI5 W3nIGNv1ghnvK8SZTAzhJO0MSolVbEPm1affcxTw= 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.14 084/222] usb: host: ohci-at91: fix request of irq for optional gpio Date: Sun, 11 Nov 2018 14:23:01 -0800 Message-Id: <20181111221655.548295205@linuxfoundation.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181111221647.665769131@linuxfoundation.org> References: <20181111221647.665769131@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.14-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 @@ -550,6 +550,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);