From patchwork Fri Dec 7 21:24:10 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Russell King (Oracle)" X-Patchwork-Id: 10720807 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2D123112E for ; Mon, 10 Dec 2018 08:08:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1D8B629B0F for ; Mon, 10 Dec 2018 08:08:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1179329B1D; Mon, 10 Dec 2018 08:08:28 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 7C21B29B0F for ; Mon, 10 Dec 2018 08:08:27 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E0D746E336; Mon, 10 Dec 2018 08:07:56 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org X-Greylist: delayed 306 seconds by postgrey-1.36 at gabe; Fri, 07 Dec 2018 21:29:29 UTC Received: from pandora.armlinux.org.uk (pandora.armlinux.org.uk [IPv6:2001:4d48:ad52:3201:214:fdff:fe10:1be6]) by gabe.freedesktop.org (Postfix) with ESMTPS id 2743D6E8C4 for ; Fri, 7 Dec 2018 21:29:29 +0000 (UTC) Received: from e0022681537dd.dyn.armlinux.org.uk ([2002:4e20:1eda:1:222:68ff:fe15:37dd]:37754 helo=rmk-PC.armlinux.org.uk) by pandora.armlinux.org.uk with esmtpsa (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.90_1) (envelope-from ) id 1gVNbX-0001lh-6J; Fri, 07 Dec 2018 21:24:11 +0000 Received: from rmk by rmk-PC.armlinux.org.uk with local (Exim 4.82_1-5b7a7c0-XX) (envelope-from ) id 1gVNbW-00041H-Cm; Fri, 07 Dec 2018 21:24:10 +0000 From: Russell King To: Tomi Valkeinen Subject: [PATCH] drm/omap: sharp ls037v7dw01: restore optional GPIOs MIME-Version: 1.0 Content-Disposition: inline Message-Id: Date: Fri, 07 Dec 2018 21:24:10 +0000 X-Mailman-Approved-At: Mon, 10 Dec 2018 08:07:52 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?unknown-8bit?q?Tony_Lindgren_=3Ctony=40atomide=2Ecom=3E=2C_David_Airli?= =?unknown-8bit?q?e_=3Cairlied=40linux=2Eie=3E=2C_dri-devel=40lists=2Efreede?= =?unknown-8bit?q?sktop=2Eorg=2C_Uwe_Kleine-K=C3=B6nig_=3Cu=2Ekleine-koenig?= =?unknown-8bit?q?=40pengutronix=2Ede=3E?= Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP The binding document for this device says that all GPIOs are optional, but the driver fails to bind on OMAP3 LDP, reporting: panel-sharp-ls037v7dw01: probe of display failed with error -2 Unfortunately, commit ca8c67dafdb7 ("fbdev: omap2: improve usage of gpiod API") removed the -ENOENT handling without converting the gpiod function to use the optional variant, causing all GPIOs to become mandatory. Since the LDP hard-wires some of the panel control signals, there are no GPIOs that could be specified in DT to satisfy this. Switch the driver to use the devm_gpiod_get_index_optional() rather than devm_gpiod_get_index() to conform to its binding documentation. Fixes: ca8c67dafdb7 ("fbdev: omap2: improve usage of gpiod API") Signed-off-by: Russell King --- drivers/gpu/drm/omapdrm/displays/panel-sharp-ls037v7dw01.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/omapdrm/displays/panel-sharp-ls037v7dw01.c b/drivers/gpu/drm/omapdrm/displays/panel-sharp-ls037v7dw01.c index 64b1369cb274..68f2f8d9c430 100644 --- a/drivers/gpu/drm/omapdrm/displays/panel-sharp-ls037v7dw01.c +++ b/drivers/gpu/drm/omapdrm/displays/panel-sharp-ls037v7dw01.c @@ -151,7 +151,7 @@ static int sharp_ls_get_gpio_of(struct device *dev, int index, int val, *gpiod = NULL; - gd = devm_gpiod_get_index(dev, desc, index, GPIOD_OUT_LOW); + gd = devm_gpiod_get_index_optional(dev, desc, index, GPIOD_OUT_LOW); if (IS_ERR(gd)) return PTR_ERR(gd);