From patchwork Fri Jul 25 11:47:21 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Olbrich X-Patchwork-Id: 4622601 Return-Path: X-Original-To: patchwork-linux-fbdev@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id BD19A9F36A for ; Fri, 25 Jul 2014 11:48:14 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id EFFAC201ED for ; Fri, 25 Jul 2014 11:48:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1380E201D5 for ; Fri, 25 Jul 2014 11:48:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751860AbaGYLsM (ORCPT ); Fri, 25 Jul 2014 07:48:12 -0400 Received: from metis.ext.pengutronix.de ([92.198.50.35]:60916 "EHLO metis.ext.pengutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751805AbaGYLsM (ORCPT ); Fri, 25 Jul 2014 07:48:12 -0400 Received: from dude.hi.pengutronix.de ([2001:6f8:1178:2:a236:9fff:fe00:814]) by metis.ext.pengutronix.de with esmtp (Exim 4.72) (envelope-from ) id 1XAdym-0001eJ-4t; Fri, 25 Jul 2014 13:48:04 +0200 Received: from mol by dude.hi.pengutronix.de with local (Exim 4.82_1-5b7a7c0-XX) (envelope-from ) id 1XAdyj-00076y-VM; Fri, 25 Jul 2014 13:48:01 +0200 From: Michael Olbrich To: Thierry Reding , Bryan Wu , Lee Jones , Alexandre Courbot Cc: linux-pwm@vger.kernel.org, linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org, kernel@pengutronix.de, Michael Olbrich Subject: [PATCH v2] pwm-backlight: fix probing from device-tree without enable-gpios Date: Fri, 25 Jul 2014 13:47:21 +0200 Message-Id: <1406288841-23140-1-git-send-email-m.olbrich@pengutronix.de> X-Mailer: git-send-email 2.0.1 In-Reply-To: <1406284115-489-1-git-send-email-m.olbrich@pengutronix.de> References: <1406284115-489-1-git-send-email-m.olbrich@pengutronix.de> X-SA-Exim-Connect-IP: 2001:6f8:1178:2:a236:9fff:fe00:814 X-SA-Exim-Mail-From: mol@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-fbdev@vger.kernel.org Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Since 257462dbf3ed ("pwm-backlight: switch to gpiod interface") enable_gpio is no longer set and remains 0 when probing from device-tree. This is a valid gpio number. With no enable-gpios specified in the device-tree this is used and probing fails with: pwm-backlight lcd-backlight.3: failed to request GPIO#0: -16 Fix this by setting enable_gpio to -1 which is not a valid gpio number. Signed-off-by: Michael Olbrich Acked-by: Alexandre Courbot --- Sorry, I sent the wrong version. This one actually compiles. Michael drivers/video/backlight/pwm_bl.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/video/backlight/pwm_bl.c b/drivers/video/backlight/pwm_bl.c index 38ca88b..e7e43cd 100644 --- a/drivers/video/backlight/pwm_bl.c +++ b/drivers/video/backlight/pwm_bl.c @@ -211,6 +211,7 @@ static int pwm_backlight_probe(struct platform_device *pdev) dev_err(&pdev->dev, "failed to find platform data\n"); return ret; } + defdata.enable_gpio = -1; data = &defdata; }