From 4f5a66b05971d6be08fd596139cd190758831686 Mon Sep 17 00:00:00 2001 From: Fabio Estevam Date: Mon, 31 Oct 2011 17:11:50 -0700 Subject: [PATCH] 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 Cc: Richard Purdie Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/video/backlight/l4f00242t03.c | 15 ++++----------- 1 file 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) 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; - priv->io_reg = regulator_get(&spi->dev, "vdd"); if (IS_ERR(priv->io_reg)) { dev_err(&spi->dev, "%s: Unable to get the IO regulator\n", -- 2.39.5