* [PATCH] Input: egalax_ts - Provide a .remove function
@ 2013-07-24 20:46 Fabio Estevam
2013-07-24 21:08 ` Dmitry Torokhov
0 siblings, 1 reply; 2+ messages in thread
From: Fabio Estevam @ 2013-07-24 20:46 UTC (permalink / raw)
To: dmitry.torokhov; +Cc: shawn.guo, linux-input, Fabio Estevam
Provide a .remove function so that we can unregister the input device.
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
---
drivers/input/touchscreen/egalax_ts.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/drivers/input/touchscreen/egalax_ts.c b/drivers/input/touchscreen/egalax_ts.c
index ef5fcb0..e46be61 100644
--- a/drivers/input/touchscreen/egalax_ts.c
+++ b/drivers/input/touchscreen/egalax_ts.c
@@ -234,6 +234,16 @@ static int egalax_ts_probe(struct i2c_client *client,
return 0;
}
+static int egalax_ts_remove(struct i2c_client *client)
+{
+ struct egalax_ts *ts = i2c_get_clientdata(client);
+
+ input_unregister_device(ts->input_dev);
+ kfree(ts);
+
+ return 0;
+}
+
static const struct i2c_device_id egalax_ts_id[] = {
{ "egalax_ts", 0 },
{ }
@@ -277,6 +287,7 @@ static struct i2c_driver egalax_ts_driver = {
},
.id_table = egalax_ts_id,
.probe = egalax_ts_probe,
+ .remove = egalax_ts_remove,
};
module_i2c_driver(egalax_ts_driver);
--
1.8.1.2
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] Input: egalax_ts - Provide a .remove function
2013-07-24 20:46 [PATCH] Input: egalax_ts - Provide a .remove function Fabio Estevam
@ 2013-07-24 21:08 ` Dmitry Torokhov
0 siblings, 0 replies; 2+ messages in thread
From: Dmitry Torokhov @ 2013-07-24 21:08 UTC (permalink / raw)
To: Fabio Estevam; +Cc: shawn.guo, linux-input
Hi Fabio,
On Wednesday, July 24, 2013 05:46:09 PM Fabio Estevam wrote:
> Provide a .remove function so that we can unregister the input device.
>
> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
> ---
> drivers/input/touchscreen/egalax_ts.c | 11 +++++++++++
> 1 file changed, 11 insertions(+)
>
> diff --git a/drivers/input/touchscreen/egalax_ts.c
> b/drivers/input/touchscreen/egalax_ts.c index ef5fcb0..e46be61 100644
> --- a/drivers/input/touchscreen/egalax_ts.c
> +++ b/drivers/input/touchscreen/egalax_ts.c
> @@ -234,6 +234,16 @@ static int egalax_ts_probe(struct i2c_client *client,
> return 0;
> }
>
> +static int egalax_ts_remove(struct i2c_client *client)
> +{
> + struct egalax_ts *ts = i2c_get_clientdata(client);
> +
> + input_unregister_device(ts->input_dev);
> + kfree(ts);
The egalax_ts driver has been converted to devm* infrastructure, using kfree()
to free memory not only unnecessary, but wrong.
Thanks.
--
Dmitry
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-07-24 21:08 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-07-24 20:46 [PATCH] Input: egalax_ts - Provide a .remove function Fabio Estevam
2013-07-24 21:08 ` Dmitry Torokhov
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).