Commit 4f5a66b0 authored by Fabio Estevam's avatar Fabio Estevam Committed by Linus Torvalds

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: default avatarFabio Estevam <fabio.estevam@freescale.com>
Cc: Richard Purdie <rpurdie@rpsys.net>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 0556dc34
...@@ -171,29 +171,22 @@ static int __devinit l4f00242t03_probe(struct spi_device *spi) ...@@ -171,29 +171,22 @@ static int __devinit l4f00242t03_probe(struct spi_device *spi)
priv->spi = 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) { if (ret) {
dev_err(&spi->dev, dev_err(&spi->dev,
"Unable to get the lcd l4f00242t03 reset gpio.\n"); "Unable to get the lcd l4f00242t03 reset gpio.\n");
goto err; goto err;
} }
ret = gpio_direction_output(pdata->reset_gpio, 1); ret = gpio_request_one(pdata->data_enable_gpio, GPIOF_OUT_INIT_LOW,
if (ret) "lcd l4f00242t03 data enable");
goto err2;
ret = gpio_request(pdata->data_enable_gpio,
"lcd l4f00242t03 data enable");
if (ret) { if (ret) {
dev_err(&spi->dev, dev_err(&spi->dev,
"Unable to get the lcd l4f00242t03 data en gpio.\n"); "Unable to get the lcd l4f00242t03 data en gpio.\n");
goto err2; goto err2;
} }
ret = gpio_direction_output(pdata->data_enable_gpio, 0);
if (ret)
goto err3;
priv->io_reg = regulator_get(&spi->dev, "vdd"); priv->io_reg = regulator_get(&spi->dev, "vdd");
if (IS_ERR(priv->io_reg)) { if (IS_ERR(priv->io_reg)) {
dev_err(&spi->dev, "%s: Unable to get the IO regulator\n", dev_err(&spi->dev, "%s: Unable to get the IO regulator\n",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment