]> Pileus Git - ~andy/linux/commit
HID: trivial devm conversion for special hid drivers
authorBenjamin Tissoires <benjamin.tissoires@redhat.com>
Wed, 24 Jul 2013 17:38:04 +0000 (19:38 +0200)
committerJiri Kosina <jkosina@suse.cz>
Wed, 31 Jul 2013 08:12:28 +0000 (10:12 +0200)
commitabf832bfc349b54fd500f1e3b612f7f3cd9dfcc6
tree4ece0e75cf3fd463be58376e3f900c1cfd60dd05
parent3366dd9fa887ebbda4872e9554f853eaeda764be
HID: trivial devm conversion for special hid drivers

It is safe to use devres allocation within the hid subsystem:
- the devres release is called _after_ the call to .remove(), meaning
  that no freed pointers will exists while removing the device
- if a .probe() fails, devres releases all the allocated ressources
  before going to the next driver: there will not be ghost ressources
  attached to a hid device if several drivers are probed.

Given that, we can clean up a little some of the HID drivers. These ones
are trivial:
- there is only one kzalloc in the driver
- the .remove() callback contains only one kfree on top of hid_hw_stop()
- the error path in the probe is easy enough to be manually checked

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
drivers/hid/hid-a4tech.c
drivers/hid/hid-apple.c
drivers/hid/hid-magicmouse.c
drivers/hid/hid-sony.c
drivers/hid/hid-zydacron.c