summaryrefslogtreecommitdiff
path: root/drivers/leds/leds-pca9532.c
diff options
context:
space:
mode:
authorAxel Lin <axel.lin@ingics.com>2012-12-25 02:16:54 -0800
committerBryan Wu <cooloney@gmail.com>2013-02-01 17:47:04 -0800
commit8614fb46637a993258146022b0140d553132a0b7 (patch)
tree3880dfec9b2cdf5b1e2250a970201bbf58b434a6 /drivers/leds/leds-pca9532.c
parent60c681a92a1bebcfccf37f446fa4e1b8f36ccbb1 (diff)
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>
Diffstat (limited to 'drivers/leds/leds-pca9532.c')
-rw-r--r--drivers/leds/leds-pca9532.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/leds/leds-pca9532.c b/drivers/leds/leds-pca9532.c
index cee8a5b483ac..43d08df6e8be 100644
--- a/drivers/leds/leds-pca9532.c
+++ b/drivers/leds/leds-pca9532.c
@@ -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;
}
@@ -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;
@@ -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;