From: Richard Weinberger Date: Tue, 6 Jul 2021 15:43:10 +0000 (+0200) Subject: misc: pci_endpoint_test: Ensure relationship between miscdev and PCI X-Git-Tag: v5.15-rc1~156^2~63 X-Git-Url: https://repo.jachan.dev/linux.git/commitdiff_plain/74a03c20bc8809a41d66ea614e55358064adbd7d 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. Signed-off-by: Richard Weinberger Link: https://lore.kernel.org/r/20210706154310.26773-1-richard@nod.at Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/misc/pci_endpoint_test.c b/drivers/misc/pci_endpoint_test.c index 1b2868ca4f2a..d1137a95ad02 100644 --- a/drivers/misc/pci_endpoint_test.c +++ b/drivers/misc/pci_endpoint_test.c @@ -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);