diff options
author | Jingoo Han <jg1.han@samsung.com> | 2012-07-30 17:40:39 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-07-30 20:25:15 -0400 |
commit | 402ff9a26427c2c8fa5424c24ba04a7f6ecc25f1 (patch) | |
tree | 136f3b5ed128e01627fa31cf52ac894d6aae5e1d /drivers/video/backlight | |
parent | f673934c615987abe16919ede8fcd3ff6805d0d6 (diff) |
backlight: tosa_lcd: use devm_gpio_request()
The devm_ functions allocate memory that is released when a driver
detaches. This patch uses devm_gpio_request() for these functions.
Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Cc: Dmitry Baryshkov <dbaryshkov@gmail.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/video/backlight')
-rw-r--r-- | drivers/video/backlight/tosa_lcd.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/drivers/video/backlight/tosa_lcd.c b/drivers/video/backlight/tosa_lcd.c index 47823b8efff..33047a66cc2 100644 --- a/drivers/video/backlight/tosa_lcd.c +++ b/drivers/video/backlight/tosa_lcd.c | |||
@@ -193,7 +193,7 @@ static int __devinit tosa_lcd_probe(struct spi_device *spi) | |||
193 | data->spi = spi; | 193 | data->spi = spi; |
194 | dev_set_drvdata(&spi->dev, data); | 194 | dev_set_drvdata(&spi->dev, data); |
195 | 195 | ||
196 | ret = gpio_request(TOSA_GPIO_TG_ON, "tg #pwr"); | 196 | ret = devm_gpio_request(&spi->dev, TOSA_GPIO_TG_ON, "tg #pwr"); |
197 | if (ret < 0) | 197 | if (ret < 0) |
198 | goto err_gpio_tg; | 198 | goto err_gpio_tg; |
199 | 199 | ||
@@ -201,7 +201,7 @@ static int __devinit tosa_lcd_probe(struct spi_device *spi) | |||
201 | 201 | ||
202 | ret = gpio_direction_output(TOSA_GPIO_TG_ON, 0); | 202 | ret = gpio_direction_output(TOSA_GPIO_TG_ON, 0); |
203 | if (ret < 0) | 203 | if (ret < 0) |
204 | goto err_gpio_dir; | 204 | goto err_gpio_tg; |
205 | 205 | ||
206 | mdelay(60); | 206 | mdelay(60); |
207 | tosa_lcd_tg_init(data); | 207 | tosa_lcd_tg_init(data); |
@@ -221,8 +221,6 @@ static int __devinit tosa_lcd_probe(struct spi_device *spi) | |||
221 | 221 | ||
222 | err_register: | 222 | err_register: |
223 | tosa_lcd_tg_off(data); | 223 | tosa_lcd_tg_off(data); |
224 | err_gpio_dir: | ||
225 | gpio_free(TOSA_GPIO_TG_ON); | ||
226 | err_gpio_tg: | 224 | err_gpio_tg: |
227 | dev_set_drvdata(&spi->dev, NULL); | 225 | dev_set_drvdata(&spi->dev, NULL); |
228 | return ret; | 226 | return ret; |
@@ -239,7 +237,6 @@ static int __devexit tosa_lcd_remove(struct spi_device *spi) | |||
239 | 237 | ||
240 | tosa_lcd_tg_off(data); | 238 | tosa_lcd_tg_off(data); |
241 | 239 | ||
242 | gpio_free(TOSA_GPIO_TG_ON); | ||
243 | dev_set_drvdata(&spi->dev, NULL); | 240 | dev_set_drvdata(&spi->dev, NULL); |
244 | 241 | ||
245 | return 0; | 242 | return 0; |