ChangeSet 1.842.46.1, 2002/11/23 23:33:37-08:00, david-b@pacbell.net

[PATCH] drivers/base/hotplug.c, fix $DEVPATH

Hotplug agents couldn't use /sys/$DEVPATH after /sys/root
morphed into /sys/devices ... now they can do it again.


diff -Nru a/drivers/base/hotplug.c b/drivers/base/hotplug.c
--- a/drivers/base/hotplug.c	Wed Nov 27 12:54:18 2002
+++ b/drivers/base/hotplug.c	Wed Nov 27 12:54:18 2002
@@ -35,6 +35,8 @@
 #define BUFFER_SIZE	1024	/* should be enough memory for the env */
 #define NUM_ENVP	32	/* number of env pointers */
 
+static char prefix [] = "devices";	/* /sys/devices/... */
+
 static int do_hotplug (struct device *dev, char *argv1, const char *action,
 			int (* hotplug) (struct device *, char **, int, char *, int))
 {
@@ -72,7 +74,7 @@
 	}
 
 	dev_length = get_devpath_length (dev);
-	dev_length += strlen("root");
+	dev_length += strlen(prefix);
 	dev_path = kmalloc (dev_length, GFP_KERNEL);
 	if (!dev_path) {
 		kfree (buffer);
@@ -80,7 +82,7 @@
 		return -ENOMEM;
 	}
 	memset (dev_path, 0x00, dev_length);
-	strcpy (dev_path, "root");
+	strcpy (dev_path, prefix);
 	fill_devpath (dev, dev_path, dev_length);
 
 	argv [0] = hotplug_path;
