On Thu, 10 Dec 2009, Dmitry Torokhov wrote: > Right, input_set_abs_params()... No, I don't really want to go through > all touchpad, touchscreen and joystick drivers at once, thank you vey > much ;) Besides, for the vast majority of uses 0 is the proper initial > value for absolute axis. Heh. > > The only other event that needs initialization are the switches, so I'd > > argue that we might as well use my proposed patch, which is specific and > > more lightweight, and convert the in-tree drivers to it. A few might be > > missing the before-registering input_event... > > As I think about it even more I think we should leave it asd is. You It needs to be documented somewhere, at least. > > BTW, looking at input.h, wouldn't it be better to force the init functions > > to be run before registering the input device, doing a BUG_ON() if they're > > misused? > > What function are you referring to? Input devices are in useable state The ones proposed in this subthread, which shouldn't be used after registering. > as returned by input_allocate_device(). Unless, of course, someone screws up verifying if input_alocate_device returned NULL... > > I'd also suggest a BUG_ON(!dev), or at least an if (!dev) return > > -EINVAL; to the top of input_register_device(...)... > > Nah, just let it crash (the same effect as BUG_ON really). There's a difference, and it is not small if it happens outside of a driver developer's test kernel. Not that I'd expect anyone to ship code so broken, that would manage to input_register_device(NULL), so I don't have any strong feelings on this. -- "One disk to rule them all, One disk to find them. One disk to bring them all and in the darkness grind them. In the Land of Redmond where the shadows lie." -- The Silicon Valley Tarot Henrique Holschuh -- To unsubscribe from this list: send the line "unsubscribe linux-acpi" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html