linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Laxman Dewangan <ldewangan@nvidia.com>
To: Sachin Kamat <sachin.kamat@linaro.org>
Cc: "linux-input@vger.kernel.org" <linux-input@vger.kernel.org>,
	"dmitry.torokhov@gmail.com" <dmitry.torokhov@gmail.com>,
	"patche@linaro.org" <patche@linaro.org>,
	Joonyoung Shim <jy0922.shim@samsung.com>
Subject: Re: [PATCH 1/1] Input: mms114: Use devm_* APIs
Date: Tue, 8 Jan 2013 16:38:19 +0530	[thread overview]
Message-ID: <50EBFE23.7070401@nvidia.com> (raw)
In-Reply-To: <1357639508-15645-1-git-send-email-sachin.kamat@linaro.org>

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@linaro.org>
> Cc: Joonyoung Shim <jy0922.shim@samsung.com>
> ---
> 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.
-----------------------------------------------------------------------------------

  reply	other threads:[~2013-01-08 11:08 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-08 10:05 [PATCH 1/1] Input: mms114: Use devm_* APIs Sachin Kamat
2013-01-08 11:08 ` Laxman Dewangan [this message]
2013-01-08 11:38   ` Sachin Kamat
2013-01-08 17:25     ` Dmitry Torokhov
2013-01-09  3:55       ` Sachin Kamat

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=50EBFE23.7070401@nvidia.com \
    --to=ldewangan@nvidia.com \
    --cc=dmitry.torokhov@gmail.com \
    --cc=jy0922.shim@samsung.com \
    --cc=linux-input@vger.kernel.org \
    --cc=patche@linaro.org \
    --cc=sachin.kamat@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).