On Tuesday 08 January 2013 03:35 PM, Sachin Kamat wrote:
devm_* APIs are device managed and make the exit and clean up code
simpler.
Signed-off-by: Sachin Kamat <sachin.kamat@xxxxxxxxxx>
Cc: Joonyoung Shim <jy0922.shim@xxxxxxxxxxx>
---
Compile tested against linux-next tree (20130108).
---
drivers/input/touchscreen/mms114.c | 41 +++++++++++------------------------
1 files changed, 13 insertions(+), 28 deletions(-)
static int mms114_remove(struct i2c_client *client)
{
struct mms114_data *data = i2c_get_clientdata(client);
- free_irq(client->irq, data);
- regulator_put(data->io_reg);
- regulator_put(data->core_reg);
input_unregister_device(data->input_dev);
Because you are using devm_input_allocate_device() for allocating input
device, you need not to have the input_unregister_device() and so you
can get rid of remove() callback at all.
This is what I learnt from Dmitry on similar patch for Tegra KBC.
Thanks,
Laxman
-----------------------------------------------------------------------------------
This email message is for the sole use of the intended recipient(s) and may contain
confidential information. Any unauthorized review, use, disclosure or distribution
is prohibited. If you are not the intended recipient, please contact the sender by
reply email and destroy all copies of the original message.
-----------------------------------------------------------------------------------
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html