[PATCH] PCI: add MODALIAS to hotplug event for pci devices

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
Greg KH 2005-05-05 11:57:25 -07:00
parent 9888549e05
commit d1ded203ad
1 changed files with 10 additions and 0 deletions

View File

@ -52,6 +52,16 @@ int pci_hotplug (struct device *dev, char **envp, int num_envp,
if ((buffer_size - length <= 0) || (i >= num_envp))
return -ENOMEM;
envp[i++] = scratch;
length += scnprintf (scratch, buffer_size - length,
"MODALIAS=pci:v%08Xd%08Xsv%08Xsd%08Xbc%02Xsc%02Xi%02x\n",
pdev->vendor, pdev->device,
pdev->subsystem_vendor, pdev->subsystem_device,
(u8)(pdev->class >> 16), (u8)(pdev->class >> 8),
(u8)(pdev->class));
if ((buffer_size - length <= 0) || (i >= num_envp))
return -ENOMEM;
envp[i] = NULL;
return 0;