Skip to content

Commit

Permalink
[PATCH] PCI: add MODALIAS to hotplug event for pci devices
Browse files Browse the repository at this point in the history
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Greg KH committed May 17, 2005
1 parent 9888549 commit d1ded20
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions drivers/pci/hotplug.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit d1ded20

Please sign in to comment.