mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 02:32:09 -04:00
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 <[email protected]> Cc: Dmitry Baryshkov <[email protected]> Cc: Richard Purdie <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
f673934c61
commit
402ff9a264
1 changed files with 2 additions and 5 deletions
|
|
@ -193,7 +193,7 @@ static int __devinit tosa_lcd_probe(struct spi_device *spi)
|
|||
data->spi = spi;
|
||||
dev_set_drvdata(&spi->dev, data);
|
||||
|
||||
ret = gpio_request(TOSA_GPIO_TG_ON, "tg #pwr");
|
||||
ret = devm_gpio_request(&spi->dev, TOSA_GPIO_TG_ON, "tg #pwr");
|
||||
if (ret < 0)
|
||||
goto err_gpio_tg;
|
||||
|
||||
|
|
@ -201,7 +201,7 @@ static int __devinit tosa_lcd_probe(struct spi_device *spi)
|
|||
|
||||
ret = gpio_direction_output(TOSA_GPIO_TG_ON, 0);
|
||||
if (ret < 0)
|
||||
goto err_gpio_dir;
|
||||
goto err_gpio_tg;
|
||||
|
||||
mdelay(60);
|
||||
tosa_lcd_tg_init(data);
|
||||
|
|
@ -221,8 +221,6 @@ static int __devinit tosa_lcd_probe(struct spi_device *spi)
|
|||
|
||||
err_register:
|
||||
tosa_lcd_tg_off(data);
|
||||
err_gpio_dir:
|
||||
gpio_free(TOSA_GPIO_TG_ON);
|
||||
err_gpio_tg:
|
||||
dev_set_drvdata(&spi->dev, NULL);
|
||||
return ret;
|
||||
|
|
@ -239,7 +237,6 @@ static int __devexit tosa_lcd_remove(struct spi_device *spi)
|
|||
|
||||
tosa_lcd_tg_off(data);
|
||||
|
||||
gpio_free(TOSA_GPIO_TG_ON);
|
||||
dev_set_drvdata(&spi->dev, NULL);
|
||||
|
||||
return 0;
|
||||
|
|
|
|||
Loading…
Reference in a new issue