mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Vishwanathrao Badarkhe, Manish" <manishv.b@ti.com>
To: <devicetree-discuss@lists.ozlabs.org>,
	<linux-input@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Cc: <dmitry.torokhov@gmail.com>, <wfp5p@virginia.edu>,
	<broonie@opensource.wolfsonmicro.com>,
	<u.kleine-koenig@pengutronix.de>, <rmk+kernel@arm.linux.org.uk>,
	<manishv.b@ti.com>
Subject: [PATCH] tps6507x-ts: update to devm_* API
Date: Sat, 23 Mar 2013 16:30:23 +0530	[thread overview]
Message-ID: <1364036423-2057-1-git-send-email-manishv.b@ti.com> (raw)

Update the code to use devm_* API so that driver
core will manage resources.

Signed-off-by: Vishwanathrao Badarkhe, Manish <manishv.b@ti.com>
---
:100644 100644 820a066... 65e0f9a... M	drivers/input/touchscreen/tps6507x-ts.c
 drivers/input/touchscreen/tps6507x-ts.c |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)

diff --git a/drivers/input/touchscreen/tps6507x-ts.c b/drivers/input/touchscreen/tps6507x-ts.c
index 820a066..65e0f9a 100644
--- a/drivers/input/touchscreen/tps6507x-ts.c
+++ b/drivers/input/touchscreen/tps6507x-ts.c
@@ -261,7 +261,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 (!tsc) {
 		dev_err(tps6507x_dev->dev, "failed to allocate driver data\n");
 		error = -ENOMEM;
@@ -339,7 +339,6 @@ err2:
 	cancel_delayed_work_sync(&tsc->work);
 	input_free_device(input_dev);
 err1:
-	kfree(tsc);
 	tps6507x_dev->ts = NULL;
 err0:
 	return error;
@@ -356,7 +355,6 @@ static int tps6507x_ts_remove(struct platform_device *pdev)
 	input_unregister_device(input_dev);
 
 	tps6507x_dev->ts = NULL;
-	kfree(tsc);
 
 	return 0;
 }
-- 
1.7.4.1


                 reply	other threads:[~2013-03-23 11:00 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=1364036423-2057-1-git-send-email-manishv.b@ti.com \
    --to=manishv.b@ti.com \
    --cc=broonie@opensource.wolfsonmicro.com \
    --cc=devicetree-discuss@lists.ozlabs.org \
    --cc=dmitry.torokhov@gmail.com \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rmk+kernel@arm.linux.org.uk \
    --cc=u.kleine-koenig@pengutronix.de \
    --cc=wfp5p@virginia.edu \
    /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

all inboxes | Powered by JetHome®