Skip to content

Commit

Permalink
driver core: Change function call order in device_bind_driver().
Browse files Browse the repository at this point in the history
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 <cornelia.huck@de.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Cornelia Huck authored and Greg Kroah-Hartman committed Feb 7, 2007
1 parent c578abb commit cb986b7
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions drivers/base/dd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit cb986b7

Please sign in to comment.