linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: yegorslists@googlemail.com
Cc: linux-input@vger.kernel.org, lee.jones@linaro.org,
	robh+dt@kernel.org, mark.rutland@arm.com,
	andrej.skvortzov@gmail.com
Subject: Re: [PATCH 1/3] tps6507x-ts: update to devm_* API
Date: Tue, 28 Feb 2017 10:57:46 -0800	[thread overview]
Message-ID: <20170228185746.GJ20776@dtor-ws> (raw)
In-Reply-To: <1487950946-18590-2-git-send-email-yegorslists@googlemail.com>

On Fri, Feb 24, 2017 at 04:42:24PM +0100, yegorslists@googlemail.com wrote:
> From: Yegor Yefremov <yegorslists@googlemail.com>
> 
> Update the code to use devm_* API so that driver
> core will manage resources.
> 
> Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
> ---
>  drivers/input/touchscreen/tps6507x-ts.c | 9 +++------
>  1 file changed, 3 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/input/touchscreen/tps6507x-ts.c b/drivers/input/touchscreen/tps6507x-ts.c
> index a340bfc..5bf1ec6 100644
> --- a/drivers/input/touchscreen/tps6507x-ts.c
> +++ b/drivers/input/touchscreen/tps6507x-ts.c
> @@ -226,7 +226,7 @@ static int tps6507x_ts_probe(struct platform_device *pdev)
>  	 */
>  	init_data = tps_board->tps6507x_ts_init_data;
>  
> -	tsc = kzalloc(sizeof(struct tps6507x_ts), GFP_KERNEL);
> +	tsc = devm_kzalloc(&pdev->dev, sizeof(struct tps6507x_ts), GFP_KERNEL);

If you do this, why not use devm_input_allocate_polled_device() as well?
Then you can get rid of tps6507x_ts_remove().

Thanks.

-- 
Dmitry

  reply	other threads:[~2017-03-01 17:34 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-24 15:42 [PATCH 0/3] Add DT support for tps6507x touchscreen yegorslists
2017-02-24 15:42 ` [PATCH 1/3] tps6507x-ts: update to devm_* API yegorslists
2017-02-28 18:57   ` Dmitry Torokhov [this message]
2017-03-01  8:13     ` Yegor Yefremov
2017-02-24 15:42 ` [PATCH 2/3] tps6507x-ts: add DT support yegorslists
2017-02-25 19:08   ` Dmitry Torokhov
2017-02-27 11:01     ` Yegor Yefremov
2017-02-28  2:16       ` Kevin Hilman
2017-02-28 10:06         ` Sekhar Nori
2017-02-28 18:41           ` Dmitry Torokhov
2017-03-01  8:21             ` Yegor Yefremov
2017-02-24 15:42 ` [PATCH 3/3] tps6507x-ts: add DT bindings description yegorslists
2017-03-14 16:46   ` Lee Jones

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=20170228185746.GJ20776@dtor-ws \
    --to=dmitry.torokhov@gmail.com \
    --cc=andrej.skvortzov@gmail.com \
    --cc=lee.jones@linaro.org \
    --cc=linux-input@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=robh+dt@kernel.org \
    --cc=yegorslists@googlemail.com \
    /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).