1 From 40985902afd8f4eb0bd7aa4238c7d458282af948 Mon Sep 17 00:00:00 2001
2 From: Jan Kiszka <jan.kiszka@siemens.com>
3 Date: Wed, 21 Dec 2016 08:20:18 +0100
4 Subject: [PATCH] ivshmem-net: Improve identification of resources
6 Pass a device name consisting of driver name and PCI ID to request_irq
7 and alloc_ordered_workqueue. This helps correlating resources with
8 devices in case there are multiple of them.
10 Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
11 (cherry picked from commit 43e2ff78b89cbdfaecba54601d85f3d40349a9b5)
13 drivers/net/ivshmem-net.c | 10 +++++++---
14 1 file changed, 7 insertions(+), 3 deletions(-)
16 --- a/drivers/net/ivshmem-net.c
17 +++ b/drivers/net/ivshmem-net.c
18 @@ -762,6 +762,7 @@ static int ivshm_net_probe(struct pci_de
19 resource_size_t shmaddr;
20 resource_size_t shmlen;
26 @@ -814,7 +815,10 @@ static int ivshm_net_probe(struct pci_de
30 - dev_info(&pdev->dev, "shared memory size %pa\n", &shmlen);
31 + device_name = devm_kasprintf(&pdev->dev, GFP_KERNEL, "%s[%s]", DRV_NAME,
32 + dev_name(&pdev->dev));
36 ndev = alloc_etherdev(sizeof(*in));
38 @@ -837,7 +841,7 @@ static int ivshm_net_probe(struct pci_de
42 - in->state_wq = alloc_ordered_workqueue(DRV_NAME, 0);
43 + in->state_wq = alloc_ordered_workqueue(device_name, 0);
47 @@ -866,7 +870,7 @@ static int ivshm_net_probe(struct pci_de
48 in->using_msix = false;
51 - err = request_irq(interrupt, ivshm_net_int, 0, DRV_NAME, ndev);
52 + err = request_irq(interrupt, ivshm_net_int, 0, device_name, ndev);