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: > > On 07/25/2011 04:30 PM, Dmitry Torokhov wrote: > > >On Wed, Jul 20, 2011 at 11:34:28PM +0800, Wanlong Gao wrote: > > >>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: > It's better to set the device's driver data to NULL > when remove it. > > Signed-off-by: Wanlong Gao <gaowanlong@xxxxxxxxxxxxxx> > --- > 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 -- To unsubscribe from this list: send the line "unsubscribe linux-input" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html