aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorFabio Estevam <festevam@gmail.com>2011-10-31 20:11:50 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2011-10-31 20:30:54 -0400
commit4f5a66b05971d6be08fd596139cd190758831686 (patch)
tree1febd4df5b515c7694f43cd11c3490736f593e71 /drivers
parent0556dc340e5159cdff925a5ab7f3a72f49745661 (diff)
drivers/video/backlight/l4f00242t03.c: use gpio_request_one() to simplify error handling
Using gpio_request_one can make the error handling simpler. Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com> Cc: Richard Purdie <rpurdie@rpsys.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/video/backlight/l4f00242t03.c15
1 files changed, 4 insertions, 11 deletions
diff --git a/drivers/video/backlight/l4f00242t03.c b/drivers/video/backlight/l4f00242t03.c
index 77ec70bcb303..3543f1b7d5f1 100644
--- a/drivers/video/backlight/l4f00242t03.c
+++ b/drivers/video/backlight/l4f00242t03.c
@@ -171,29 +171,22 @@ static int __devinit l4f00242t03_probe(struct spi_device *spi)
171 171
172 priv->spi = spi; 172 priv->spi = spi;
173 173
174 ret = gpio_request(pdata->reset_gpio, "lcd l4f00242t03 reset"); 174 ret = gpio_request_one(pdata->reset_gpio, GPIOF_OUT_INIT_HIGH,
175 "lcd l4f00242t03 reset");
175 if (ret) { 176 if (ret) {
176 dev_err(&spi->dev, 177 dev_err(&spi->dev,
177 "Unable to get the lcd l4f00242t03 reset gpio.\n"); 178 "Unable to get the lcd l4f00242t03 reset gpio.\n");
178 goto err; 179 goto err;
179 } 180 }
180 181
181 ret = gpio_direction_output(pdata->reset_gpio, 1); 182 ret = gpio_request_one(pdata->data_enable_gpio, GPIOF_OUT_INIT_LOW,
182 if (ret) 183 "lcd l4f00242t03 data enable");
183 goto err2;
184
185 ret = gpio_request(pdata->data_enable_gpio,
186 "lcd l4f00242t03 data enable");
187 if (ret) { 184 if (ret) {
188 dev_err(&spi->dev, 185 dev_err(&spi->dev,
189 "Unable to get the lcd l4f00242t03 data en gpio.\n"); 186 "Unable to get the lcd l4f00242t03 data en gpio.\n");
190 goto err2; 187 goto err2;
191 } 188 }
192 189
193 ret = gpio_direction_output(pdata->data_enable_gpio, 0);
194 if (ret)
195 goto err3;
196
197 priv->io_reg = regulator_get(&spi->dev, "vdd"); 190 priv->io_reg = regulator_get(&spi->dev, "vdd");
198 if (IS_ERR(priv->io_reg)) { 191 if (IS_ERR(priv->io_reg)) {
199 dev_err(&spi->dev, "%s: Unable to get the IO regulator\n", 192 dev_err(&spi->dev, "%s: Unable to get the IO regulator\n",