# \[PATCH\] drivers:input:set driver data to NULL for pcap\_keys

- From: Wanlong Gao \<hidden\>
- Date: 2011-07-20 15:37:41 
- List: linux-input
- Page: https://ratatoskr.run/linux-input/2011/07/8917274
- Thread: https://ratatoskr.run/linux-input/2011/07/8917274/t.md

```text
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;
 }
 
-- 
1.7.4.1

```
