Commit cb986b749c7178422bfbc982cd30e04d5db54bbc
Committed by
Greg Kroah-Hartman
1 parent
c578abbc20
Exists in
master
and in
20 other branches
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 <cornelia.huck@de.ibm.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Showing 1 changed file with 6 additions and 2 deletions Side-by-side Diff
drivers/base/dd.c
... | ... | @@ -86,8 +86,12 @@ |
86 | 86 | */ |
87 | 87 | int device_bind_driver(struct device *dev) |
88 | 88 | { |
89 | - driver_bound(dev); | |
90 | - return driver_sysfs_add(dev); | |
89 | + int ret; | |
90 | + | |
91 | + ret = driver_sysfs_add(dev); | |
92 | + if (!ret) | |
93 | + driver_bound(dev); | |
94 | + return ret; | |
91 | 95 | } |
92 | 96 | |
93 | 97 | struct stupid_thread_structure { |