Thread (19 messages) flat view 19 messages, 5 authors, 2011-07-26

Re: [PATCH] drivers:input:set driver data to NULL for pcap_keys

From: Wanlong Gao <hidden>
Date: 2011-07-25 15:34:43

On Mon, 2011-07-25 at 08:21 -0700, Greg KH wrote:
On Mon, Jul 25, 2011 at 05:14:11PM +0800, Wanlong Gao wrote:
quoted
On 07/25/2011 04:30 PM, Dmitry Torokhov wrote:
quoted
On Wed, Jul 20, 2011 at 11:34:28PM +0800, Wanlong Gao wrote:
quoted
It's better to set the device's driver data to NULL
when remove it.
I'd rather have platform devices core clean up this pointer, then we
could stop caring about it in all drivers...
But the platform devices core just call the method of each own.
And don't care about the details like pdata, etc.

Meanwhile, I think the platform core need not care about these details.

and Greg, what do you think about this?
I don't understand what you are asking me.
Sorry, that's below:
firt for this patch:
quoted hunk ↗ jump to hunk
It's better to set the device's driver data to NULL
when remove it.

Signed-off-by: Wanlong Gao <redacted>
---
 drivers/input/misc/pcap_keys.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/drivers/input/misc/pcap_keys.c
b/drivers/input/misc/pcap_keys.c
index 99335c2..6c670f5 100644
--- a/drivers/input/misc/pcap_keys.c
+++ b/drivers/input/misc/pcap_keys.c
@@ -114,6 +114,8 @@ static int __devexit pcap_keys_remove(struct
platform_device *pdev)
        input_unregister_device(pcap_keys->input);
        kfree(pcap_keys);
 
+       platform_set_drvdata(pdev, NULL);
+
        return 0;
 }
then, Dmitry said that:
I'd rather have platform devices core clean up this pointer, then we
could stop caring about it in all drivers...
then I said:
But the platform devices core just call the method of each own.
And don't care about the details like pdata, etc.

Meanwhile, I think the platform core need not care about these
details.

and Greg, what do you think about this?
this is the thread, Greg, understand now?

For short, it's all about the platform driver data. Since many drivers
set the platform driver data to NULL when it is removed, then Dmitry
think it should be done in the platform driver core instead.
So, I asked you for this.

It's clear now?

Thanks a lot
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help