提交 4f5a66b0 编写于 作者: F Fabio Estevam 提交者: 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: NFabio Estevam <fabio.estevam@freescale.com>
Cc: Richard Purdie <rpurdie@rpsys.net>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 0556dc34
......@@ -171,18 +171,15 @@ 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,
ret = gpio_request_one(pdata->data_enable_gpio, GPIOF_OUT_INIT_LOW,
"lcd l4f00242t03 data enable");
if (ret) {
dev_err(&spi->dev,
......@@ -190,10 +187,6 @@ static int __devinit l4f00242t03_probe(struct spi_device *spi)
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",
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册