From patchwork Fri Aug 19 03:58:27 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Estevam Fabio-R49496 X-Patchwork-Id: 1078712 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter2.kernel.org (8.14.4/8.14.4) with ESMTP id p7J40s56003835 for ; Fri, 19 Aug 2011 04:00:55 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750707Ab1HSEAx (ORCPT ); Fri, 19 Aug 2011 00:00:53 -0400 Received: from am1ehsobe001.messaging.microsoft.com ([213.199.154.204]:22138 "EHLO AM1EHSOBE001.bigfish.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750703Ab1HSEAw convert rfc822-to-8bit (ORCPT ); Fri, 19 Aug 2011 00:00:52 -0400 Received: from mail32-am1-R.bigfish.com (10.3.201.247) by AM1EHSOBE001.bigfish.com (10.3.204.21) with Microsoft SMTP Server id 14.1.225.22; Fri, 19 Aug 2011 04:00:51 +0000 Received: from mail32-am1 (localhost.localdomain [127.0.0.1]) by mail32-am1-R.bigfish.com (Postfix) with ESMTP id 61C4C4100C3; Fri, 19 Aug 2011 04:00:51 +0000 (UTC) X-SpamScore: -8 X-BigFish: VS-8(zz9371K542Mzz1202hzz8275bh8275dhz2dh2a8h668h839h8e2h8e3h944h61h) X-Spam-TCS-SCL: 0:0 X-Forefront-Antispam-Report: CIP:70.37.183.190; KIP:(null); UIP:(null); IPVD:NLI; H:mail.freescale.net; RD:none; EFVD:NLI Received: from mail32-am1 (localhost.localdomain [127.0.0.1]) by mail32-am1 (MessageSwitch) id 1313726426653576_19592; Fri, 19 Aug 2011 04:00:26 +0000 (UTC) Received: from AM1EHSMHS017.bigfish.com (unknown [10.3.201.252]) by mail32-am1.bigfish.com (Postfix) with ESMTP id 2C4599F0053; Fri, 19 Aug 2011 03:58:32 +0000 (UTC) Received: from mail.freescale.net (70.37.183.190) by AM1EHSMHS017.bigfish.com (10.3.207.155) with Microsoft SMTP Server (TLS) id 14.1.225.22; Fri, 19 Aug 2011 03:58:29 +0000 Received: from 039-SN1MPN1-003.039d.mgd.msft.net ([169.254.3.205]) by 039-SN1MMR1-001.039d.mgd.msft.net ([10.84.1.13]) with mapi id 14.01.0323.002; Thu, 18 Aug 2011 22:58:27 -0500 From: Estevam Fabio-R49496 To: "rpurdie@rpsys.net" CC: Fabio Estevam , "linux-fbdev@vger.kernel.org" Subject: RE: [PATCH] backlight: l4f00242t03: Use gpio_request_one to simplify error handling Thread-Topic: [PATCH] backlight: l4f00242t03: Use gpio_request_one to simplify error handling Thread-Index: AQHMMpxFGORpGmbqXEKMjMZ3F/Yhr5Uj4wlQ Date: Fri, 19 Aug 2011 03:58:27 +0000 Message-ID: References: <1308939980-14341-1-git-send-email-festevam@gmail.com> In-Reply-To: <1308939980-14341-1-git-send-email-festevam@gmail.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [201.82.76.9] MIME-Version: 1.0 X-OriginatorOrg: freescale.com Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Fri, 19 Aug 2011 04:00:55 +0000 (UTC) Richard, Ping? -----Original Message----- From: Fabio Estevam [mailto:festevam@gmail.com] Sent: Friday, June 24, 2011 3:26 PM To: linux-fbdev@vger.kernel.org Cc: rpurdie@rpsys.net; Fabio Estevam; Estevam Fabio-R49496 Subject: [PATCH] backlight: l4f00242t03: Use gpio_request_one to simplify error handling Using gpio_request_one can make the error handling simpler. Signed-off-by: Fabio Estevam --- drivers/video/backlight/l4f00242t03.c | 17 +++++------------ 1 files changed, 5 insertions(+), 12 deletions(-) diff --git a/drivers/video/backlight/l4f00242t03.c b/drivers/video/backlight/l4f00242t03.c index 98ad3e5..d6b0812 100644 --- a/drivers/video/backlight/l4f00242t03.c +++ b/drivers/video/backlight/l4f00242t03.c @@ -178,29 +178,22 @@ static int __devinit l4f00242t03_probe(struct spi_device *spi) priv->spi = spi; - ret = gpio_request(pdata->reset_gpio, "lcd l4f00242t03 reset"); + ret = gpio_request_one(pdata->reset_gpio, GPIOF_OUT_INIT_HIGH, + "lcd l4f00242t03 reset"); if (ret) { dev_err(&spi->dev, "Unable to get the lcd l4f00242t03 reset gpio.\n"); goto err; } - ret = gpio_direction_output(pdata->reset_gpio, 1); - if (ret) - goto err2; - - ret = gpio_request(pdata->data_enable_gpio, - "lcd l4f00242t03 data enable"); + ret = gpio_request_one(pdata->data_enable_gpio, GPIOF_OUT_INIT_LOW, + "lcd l4f00242t03 data enable"); if (ret) { dev_err(&spi->dev, "Unable to get the lcd l4f00242t03 data en gpio.\n"); goto err2; } - - ret = gpio_direction_output(pdata->data_enable_gpio, 0); - if (ret) - goto err3; - + if (pdata->io_supply) { priv->io_reg = regulator_get(NULL, pdata->io_supply);