mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 11:41:38 -04:00
backlight: tosa_bl: 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
402ff9a264
commit
f5b71941a5
1 changed files with 2 additions and 6 deletions
|
|
@ -92,14 +92,14 @@ static int __devinit tosa_bl_probe(struct i2c_client *client,
|
|||
|
||||
data->comadj = sharpsl_param.comadj == -1 ? COMADJ_DEFAULT : sharpsl_param.comadj;
|
||||
|
||||
ret = gpio_request(TOSA_GPIO_BL_C20MA, "backlight");
|
||||
ret = devm_gpio_request(&client->dev, TOSA_GPIO_BL_C20MA, "backlight");
|
||||
if (ret) {
|
||||
dev_dbg(&data->bl->dev, "Unable to request gpio!\n");
|
||||
return ret;
|
||||
}
|
||||
ret = gpio_direction_output(TOSA_GPIO_BL_C20MA, 0);
|
||||
if (ret)
|
||||
goto err_gpio_dir;
|
||||
return ret;
|
||||
|
||||
i2c_set_clientdata(client, data);
|
||||
data->i2c = client;
|
||||
|
|
@ -123,8 +123,6 @@ static int __devinit tosa_bl_probe(struct i2c_client *client,
|
|||
|
||||
err_reg:
|
||||
data->bl = NULL;
|
||||
err_gpio_dir:
|
||||
gpio_free(TOSA_GPIO_BL_C20MA);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
@ -135,8 +133,6 @@ static int __devexit tosa_bl_remove(struct i2c_client *client)
|
|||
backlight_device_unregister(data->bl);
|
||||
data->bl = NULL;
|
||||
|
||||
gpio_free(TOSA_GPIO_BL_C20MA);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue