Skip to contentSkip to conversation

misc: pci_endpoint_test: Ensure relationship between miscdev and PCI

PATCH New Richard Weinberger 1 participant 1 message Jul 6, 2021

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 misc: pci_endpoint_test: Ensure relationship between miscdev and PCI

Set the parent pointer of the misc device to ensure a relationship between PCI and misc dev. That way it is possible to see in /sys/class/misc/ which pci_endpoint_test instance serves what PCI device.

---
 drivers/misc/pci_endpoint_test.c | 1 +
 1 file changed, 1 insertion(+)
drivers/misc/pci_endpoint_test.c +1 -0
index 1b2868ca4f2a..d1137a95ad02 100644
@@ -862,6 +862,7 @@ static int pci_endpoint_test_probe(struct pci_dev *pdev,
 		err = -ENOMEM;
 		goto err_release_irq;
 	}
+	misc_device->parent = &pdev->dev;
 	misc_device->fops = &pci_endpoint_test_fops,
 
 	err = misc_register(misc_device);
Signature · 1 line
2.26.2