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

From: Kishon Vijay Abraham I
Date: Mon Dec 30 2019 - 07:31:47 EST


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@xxxxxx>
---
drivers/misc/pci_endpoint_test.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)

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])
--
2.17.1