Commit 489a826c authored by Kay Sievers's avatar Kay Sievers Committed by Greg Kroah-Hartman

[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: default avatarKay Sievers <kay.sievers@vrfy.org>
Signed-off-by: default avatarGreg Kroah-Hartman <greg@kroah.com>
parent 024d8811
......@@ -303,6 +303,12 @@ static int class_hotplug(struct kset *kset, struct kobject *kobj, char **envp,
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];
......
......@@ -469,6 +469,12 @@ static int block_hotplug(struct kset *kset, struct kobject *kobj, char **envp,
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;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment