Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d1ded203 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman
Browse files

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

parent 9888549e
Loading
Loading
Loading
Loading
+10 −0
Original line number Original line Diff line number Diff line
@@ -52,6 +52,16 @@ int pci_hotplug (struct device *dev, char **envp, int num_envp,
	if ((buffer_size - length <= 0) || (i >= num_envp))
	if ((buffer_size - length <= 0) || (i >= num_envp))
		return -ENOMEM;
		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;
	envp[i] = NULL;


	return 0;
	return 0;