On Sat, Apr 10, 2010 at 09:19:17PM +0200, Jiri Kosina wrote: > On Sat, 10 Apr 2010, Stéphane Chatty wrote: > > > > Am Samstag, den 10.04.2010, 16:43 +0200 schrieb Stephane Chatty: > > > > Added support for the eGalax dual-touch panel, found on the Asus EeePC > > > > T101MT > > > > > > > +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? In general as a driver writer I'd expect data structiures passed to me by the core (in this case hid core) be initialized and useable... -- Dmitry -- 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