* [Patch 5/7] driver core: Change function call order in device_bind_driver().
@ 2006-11-27 9:35 Cornelia Huck
0 siblings, 0 replies; 2+ messages in thread
From: Cornelia Huck @ 2006-11-27 9:35 UTC (permalink / raw)
To: Greg K-H; +Cc: Andrew Morton, linux-kernel
From: Cornelia Huck <cornelia.huck@de.ibm.com>
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>
---
drivers/base/dd.c | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
--- linux-2.6-CH.orig/drivers/base/dd.c
+++ linux-2.6-CH/drivers/base/dd.c
@@ -86,8 +86,12 @@ static void driver_sysfs_remove(struct d
*/
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 {
^ permalink raw reply [flat|nested] 2+ messages in thread
* [Patch 5/7] driver core: Change function call order in device_bind_driver().
@ 2006-10-27 11:36 Cornelia Huck
0 siblings, 0 replies; 2+ messages in thread
From: Cornelia Huck @ 2006-10-27 11:36 UTC (permalink / raw)
To: Greg K-H; +Cc: linux-kernel, Andrew Morton
From: Cornelia Huck <cornelia.huck@de.ibm.com>
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>
---
drivers/base/dd.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
--- linux-2.6.orig/drivers/base/dd.c
+++ linux-2.6/drivers/base/dd.c
@@ -85,8 +85,12 @@ static void driver_sysfs_remove(struct d
*/
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 {
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2006-11-27 9:34 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-11-27 9:35 [Patch 5/7] driver core: Change function call order in device_bind_driver() Cornelia Huck
-- strict thread matches above, loose matches on Subject: below --
2006-10-27 11:36 Cornelia Huck
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®