From: Jingoo Han Date: Fri, 9 Nov 2012 03:04:44 +0000 (+1100) Subject: backlight: lms283gf05: use devm_gpio_request_one X-Git-Tag: next-20121112~5^2~110 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=b2ce7e34b3eae6f17eafd6897a3f9904fd5481dd;p=karo-tx-linux.git backlight: lms283gf05: use devm_gpio_request_one By using devm_gpio_request_one it is possible to set the direction and initial value in one shot. Thus, using devm_gpio_request_one can make the code simpler. Signed-off-by: Jingoo Han Cc: Richard Purdie Acked-by: Marek Vasut Signed-off-by: Andrew Morton --- diff --git a/drivers/video/backlight/lms283gf05.c b/drivers/video/backlight/lms283gf05.c index ea43f2254196..c452210f7aa6 100644 --- a/drivers/video/backlight/lms283gf05.c +++ b/drivers/video/backlight/lms283gf05.c @@ -158,13 +158,9 @@ static int __devinit lms283gf05_probe(struct spi_device *spi) int ret = 0; if (pdata != NULL) { - ret = devm_gpio_request(&spi->dev, pdata->reset_gpio, - "LMS285GF05 RESET"); - if (ret) - return ret; - - ret = gpio_direction_output(pdata->reset_gpio, - !pdata->reset_inverted); + ret = devm_gpio_request_one(&spi->dev, pdata->reset_gpio, + GPIOF_DIR_OUT | !pdata->reset_inverted, + "LMS285GF05 RESET"); if (ret) return ret; }