[6/7] misc: pci_endpoint_test: Use full pci-endpoint-test name in request irq
diff mbox series

Message ID 20191230123315.31037-7-kishon@ti.com
State New
Delegated to: Lorenzo Pieralisi
Headers show
Series
  • Improvements to pci_endpoint_test driver
Related show

Commit Message

Kishon Vijay Abraham I Dec. 30, 2019, 12:33 p.m. UTC
Use full pci-endpoint-test name in request irq, so that it's easy to
profile the device that actually raised the interrupt.

Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
---
 drivers/misc/pci_endpoint_test.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

Patch
diff mbox series

diff --git a/drivers/misc/pci_endpoint_test.c b/drivers/misc/pci_endpoint_test.c
index b622e234f57c..dae450c1a653 100644
--- a/drivers/misc/pci_endpoint_test.c
+++ b/drivers/misc/pci_endpoint_test.c
@@ -108,6 +108,7 @@  struct pci_endpoint_test {
 	struct miscdevice miscdev;
 	enum pci_barno test_reg_bar;
 	size_t alignment;
+	const char *name;
 };
 
 struct pci_endpoint_test_data {
@@ -226,7 +227,7 @@  static bool pci_endpoint_test_request_irq(struct pci_endpoint_test *test)
 	for (i = 0; i < test->num_irqs; i++) {
 		err = devm_request_irq(dev, pci_irq_vector(pdev, i),
 				       pci_endpoint_test_irqhandler,
-				       IRQF_SHARED, DRV_MODULE_NAME, test);
+				       IRQF_SHARED, test->name, test);
 		if (err)
 			goto fail;
 	}
@@ -752,6 +753,7 @@  static int pci_endpoint_test_probe(struct pci_dev *pdev,
 		dev_err(dev, "Failed to register device\n");
 		goto err_kfree_name;
 	}
+	test->name = kstrdup(name, GFP_KERNEL);
 
 	return 0;
 
@@ -792,6 +794,7 @@  static void pci_endpoint_test_remove(struct pci_dev *pdev)
 
 	misc_deregister(&test->miscdev);
 	kfree(misc_device->name);
+	kfree(test->name);
 	ida_simple_remove(&pci_endpoint_test_ida, id);
 	for (bar = 0; bar < PCI_STD_NUM_BARS; bar++) {
 		if (test->bar[bar])