On Sun, 11 Apr 2010, Dmitry Torokhov wrote: > > > > > +static void egalax_remove(struct hid_device *hdev) > > > > > +{ > > > > > + hid_hw_stop(hdev); > > > > > + kfree(hid_get_drvdata(hdev)); > > > > > + hid_set_drvdata(hdev, NULL); > > > > > +} > > > > > > > > Why not using hid_hw_stop() instead of hid_set_drvdata()? > > > > > > > > > > Er, actually for a previous driver Dmitry suggested to add this line and > > > I did it without trying to understand :-) > > > > Currently no code should be relying on this, but it's always nice/safe to > > do such initialization. > > > > Using 'if (!hdev)' to check whether hdev is valid/initialized or not > > should be always legitimate thing to do. > > How can hdev be NULL? You did you mean hid_get_drvdata(hdev) != NULL? Yup, sorry. -- Jiri Kosina SUSE Labs, Novell Inc. -- 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