summaryrefslogtreecommitdiffstats
path: root/drivers/staging/nvec
diff options
context:
space:
mode:
authorLeon Romanovsky <leon@leon.nu>2013-05-14 12:22:07 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-05-16 16:04:31 -0700
commit167bf09e2e032fab0ae6fe2dee200cc33a8c4231 (patch)
tree82bb80f4cfa5c93998398b50c1fd41f38d366f57 /drivers/staging/nvec
parent5e763f7bd9fea0027e246e6c2cee291566a390a9 (diff)
downloadlinux-167bf09e2e032fab0ae6fe2dee200cc33a8c4231.tar.bz2
staging: nvec: Convert to use devm_input_allocate
nvec_kbd is converted to use devm_input_allocate. This simplifies error handling and remove path. Signed-off-by: Leon Romanovsky <leon@leon.nu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/nvec')
-rw-r--r--drivers/staging/nvec/nvec_kbd.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/drivers/staging/nvec/nvec_kbd.c b/drivers/staging/nvec/nvec_kbd.c
index a0ec52a4114f..c17a1c3eb3ca 100644
--- a/drivers/staging/nvec/nvec_kbd.c
+++ b/drivers/staging/nvec/nvec_kbd.c
@@ -126,7 +126,7 @@ static int nvec_kbd_probe(struct platform_device *pdev)
for (i = 0; i < ARRAY_SIZE(extcode_tab_us102); ++i)
keycodes[j++] = extcode_tab_us102[i];
- idev = input_allocate_device();
+ idev = devm_input_allocate_device(&pdev->dev);
idev->name = "nvec keyboard";
idev->phys = "nvec";
idev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_REP) | BIT_MASK(EV_LED);
@@ -142,7 +142,7 @@ static int nvec_kbd_probe(struct platform_device *pdev)
clear_bit(0, idev->keybit);
err = input_register_device(idev);
if (err)
- goto fail;
+ return err;
keys_dev.input = idev;
keys_dev.notifier.notifier_call = nvec_keys_notifier;
@@ -161,10 +161,6 @@ static int nvec_kbd_probe(struct platform_device *pdev)
nvec_write_async(nvec, clear_leds, sizeof(clear_leds));
return 0;
-
-fail:
- input_free_device(idev);
- return err;
}
static int nvec_kbd_remove(struct platform_device *pdev)
@@ -177,8 +173,6 @@ static int nvec_kbd_remove(struct platform_device *pdev)
nvec_write_async(nvec, disable_kbd, 2);
nvec_unregister_notifier(nvec, &keys_dev.notifier);
- input_unregister_device(keys_dev.input);
-
return 0;
}