Re: [PATCH] More Driver Core patches for 2.6.10-rc1

From: Greg KH
Date: Fri Nov 12 2004 - 21:46:25 EST


ChangeSet 1.2097, 2004/11/12 11:43:08-08:00, kay.sievers@xxxxxxxx

[PATCH] add the driver name to the hotplug environment

Add the name of the device's driver to the hotplug environment of class
and block devices.

ACTION=add
DEVPATH=/block/sda
SUBSYSTEM=block
SEQNUM=986
PHYSDEVPATH=/devices/pci0000:00/0000:00:1d.1/usb3/3-1/3-1:1.0/host0/target0:0:0/0:0:0:0
PHYSDEVBUS=scsi
PHYSDEVDRIVER=sd

Signed-off-by: Kay Sievers <kay.sievers@xxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <greg@xxxxxxxxx>


drivers/base/class.c | 6 ++++++
drivers/block/genhd.c | 6 ++++++
2 files changed, 12 insertions(+)


diff -Nru a/drivers/base/class.c b/drivers/base/class.c
--- a/drivers/base/class.c 2004-11-12 14:53:11 -08:00
+++ b/drivers/base/class.c 2004-11-12 14:53:11 -08:00
@@ -303,6 +303,12 @@
buffer, buffer_size, &length,
"PHYSDEVBUS=%s", dev->bus->name);

+ /* add driver name of physical device */
+ if (dev->driver)
+ add_hotplug_env_var(envp, num_envp, &i,
+ buffer, buffer_size, &length,
+ "PHYSDEVDRIVER=%s", dev->driver->name);
+
/* terminate, set to next free slot, shrink available space */
envp[i] = NULL;
envp = &envp[i];
diff -Nru a/drivers/block/genhd.c b/drivers/block/genhd.c
--- a/drivers/block/genhd.c 2004-11-12 14:53:11 -08:00
+++ b/drivers/block/genhd.c 2004-11-12 14:53:11 -08:00
@@ -469,6 +469,12 @@
buffer, buffer_size, &length,
"PHYSDEVBUS=%s", dev->bus->name);

+ /* add driver name of physical device */
+ if (dev->driver)
+ add_hotplug_env_var(envp, num_envp, &i,
+ buffer, buffer_size, &length,
+ "PHYSDEVDRIVER=%s", dev->driver->name);
+
envp[i] = NULL;
}


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/