From: Cornelia Huck Date: Mon, 27 Nov 2006 09:35:12 +0000 (+0100) Subject: driver core: Change function call order in device_bind_driver(). X-Git-Tag: v2.6.21-rc2~42^2~10^2~12 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=cb986b749c7178422bfbc982cd30e04d5db54bbc;p=linux-2.6-omap-h63xx.git driver core: Change function call order in device_bind_driver(). Change function call order in device_bind_driver(). If we create symlinks (which might fail) before adding the device to the list we don't have to clean up afterwards (which we didn't). Signed-off-by: Cornelia Huck Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/base/dd.c b/drivers/base/dd.c index f7051374894..b5bf243d9cd 100644 --- a/drivers/base/dd.c +++ b/drivers/base/dd.c @@ -86,8 +86,12 @@ static void driver_sysfs_remove(struct device *dev) */ int device_bind_driver(struct device *dev) { - driver_bound(dev); - return driver_sysfs_add(dev); + int ret; + + ret = driver_sysfs_add(dev); + if (!ret) + driver_bound(dev); + return ret; } struct stupid_thread_structure {