Input: adp5589-keys - use device-managed function in adp5589_keypad_add()
authorAlexandru Ardelean <alexandru.ardelean@analog.com>
Thu, 19 Nov 2020 06:41:46 +0000 (22:41 -0800)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Thu, 19 Nov 2020 07:18:24 +0000 (23:18 -0800)
commit760a1219ff264c4bb68ae561bf4d5eea5daac8dc
tree5e28902688a0ec92a5637a0b037f84e1824d7093
parent41d7d26b8fb26e7e8056c1a3b6cf358d40cb367a
Input: adp5589-keys - use device-managed function in adp5589_keypad_add()

This change makes use of the devm_input_allocate_device() function, which
gets rid of the input_free_device() and input_unregister_device() calls.

When a device is allocated via input_allocate_device(), the
input_register_device() call will also be device-managed, so there is no
longer need to manually call unregister.

Also, the irq is allocated with the devm_request_threaded_irq(), so with
these two changes, the adp5589_keypad_remove() function is no longer
needed.

This cleans up the error & exit paths.

Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Link: https://lore.kernel.org/r/20201112074308.71351-3-alexandru.ardelean@analog.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
drivers/input/keyboard/adp5589-keys.c