Skip to content

Commit

Permalink
leds: pca9532: Convert to devm_input_allocate_device()
Browse files Browse the repository at this point in the history
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Bryan Wu <cooloney@gmail.com>
  • Loading branch information
Axel Lin authored and Bryan Wu committed Feb 2, 2013
1 parent 60c681a commit 8614fb4
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions drivers/leds/leds-pca9532.c
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,6 @@ static int pca9532_destroy_devices(struct pca9532_data *data, int n_devs)
break;
case PCA9532_TYPE_N2100_BEEP:
if (data->idev != NULL) {
input_unregister_device(data->idev);
cancel_work_sync(&data->work);
data->idev = NULL;
}
Expand Down Expand Up @@ -382,7 +381,7 @@ static int pca9532_configure(struct i2c_client *client,
BUG_ON(data->idev);
led->state = PCA9532_PWM1;
pca9532_setled(led);
data->idev = input_allocate_device();
data->idev = devm_input_allocate_device(&client->dev);
if (data->idev == NULL) {
err = -ENOMEM;
goto exit;
Expand All @@ -401,7 +400,6 @@ static int pca9532_configure(struct i2c_client *client,
INIT_WORK(&data->work, pca9532_input_work);
err = input_register_device(data->idev);
if (err) {
input_free_device(data->idev);
cancel_work_sync(&data->work);
data->idev = NULL;
goto exit;
Expand Down

0 comments on commit 8614fb4

Please sign in to comment.