sysdev: Do not register with sysdev when erroring on add
authorBorislav Petkov <borislav.petkov@amd.com>
Tue, 1 Feb 2011 16:19:56 +0000 (17:19 +0100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 3 Feb 2011 23:41:03 +0000 (15:41 -0800)
commitf4203e3032e5ae74c3e89df85a5a6d96022d0c49
treec1030cc10185144df78137ad2bf85ef03ede3d54
parent1f7da214e26a8ee4fbb66af50e27147d5d115c5a
sysdev: Do not register with sysdev when erroring on add

When encountering an error while executing the driver's ->add method, we
should cancel registration and unwind what we've regged so far. The low
level ->add methods do return proper error codes but those aren't looked
at in sysdev_driver_register(). Fix that by sharing the unregistering
code.

Signed-off-by: Borislav Petkov <borislav.petkov@amd.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/base/sys.c