mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-12 08:09:56 +00:00
leds: pca9532: Convert to devm_input_allocate_device()
Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Bryan Wu <cooloney@gmail.com>
This commit is contained in:
parent
60c681a92a
commit
8614fb4663
@ -311,7 +311,6 @@ static int pca9532_destroy_devices(struct pca9532_data *data, int n_devs)
|
|||||||
break;
|
break;
|
||||||
case PCA9532_TYPE_N2100_BEEP:
|
case PCA9532_TYPE_N2100_BEEP:
|
||||||
if (data->idev != NULL) {
|
if (data->idev != NULL) {
|
||||||
input_unregister_device(data->idev);
|
|
||||||
cancel_work_sync(&data->work);
|
cancel_work_sync(&data->work);
|
||||||
data->idev = NULL;
|
data->idev = NULL;
|
||||||
}
|
}
|
||||||
@ -382,7 +381,7 @@ static int pca9532_configure(struct i2c_client *client,
|
|||||||
BUG_ON(data->idev);
|
BUG_ON(data->idev);
|
||||||
led->state = PCA9532_PWM1;
|
led->state = PCA9532_PWM1;
|
||||||
pca9532_setled(led);
|
pca9532_setled(led);
|
||||||
data->idev = input_allocate_device();
|
data->idev = devm_input_allocate_device(&client->dev);
|
||||||
if (data->idev == NULL) {
|
if (data->idev == NULL) {
|
||||||
err = -ENOMEM;
|
err = -ENOMEM;
|
||||||
goto exit;
|
goto exit;
|
||||||
@ -401,7 +400,6 @@ static int pca9532_configure(struct i2c_client *client,
|
|||||||
INIT_WORK(&data->work, pca9532_input_work);
|
INIT_WORK(&data->work, pca9532_input_work);
|
||||||
err = input_register_device(data->idev);
|
err = input_register_device(data->idev);
|
||||||
if (err) {
|
if (err) {
|
||||||
input_free_device(data->idev);
|
|
||||||
cancel_work_sync(&data->work);
|
cancel_work_sync(&data->work);
|
||||||
data->idev = NULL;
|
data->idev = NULL;
|
||||||
goto exit;
|
goto exit;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user