]> git.baikalelectronics.ru Git - kernel.git/commit
driver core: add devm_device_add_group() and friends
authorDmitry Torokhov <dmitry.torokhov@gmail.com>
Thu, 20 Jul 2017 00:24:33 +0000 (17:24 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 22 Jul 2017 09:59:23 +0000 (11:59 +0200)
commitc6243e974ac2b8f4215173e054bc8df1852ea588
tree94f60efe6120ca7cb9214d5ed98a5e7ecb95f812
parentd5e40c978d385aeddf529cc56cf1fcf9d480a7d0
driver core: add devm_device_add_group() and friends

Many drivers create additional driver-specific device attributes when
binding to the device, and providing managed version of
device_create_group() will simplify unbinding and error handling in probe
path for such drivers.

Without managed version driver writers either have to mix manual and
managed resources, which is prone to errors, or open-code this function by
providing a wrapper to device_add_group() and use it with devm_add_action()
or devm_add_action_or_reset().

Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/base/core.c
include/linux/device.h