Re: [PATCH 1/1] Input: mms114: Use devm_* APIs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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


[Index of Archives]     [Linux Media Devel]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Linux Wireless Networking]     [Linux Omap]

  Powered by Linux