net: dsa: mv88e6xxx: Unique ATU and VTU IRQ names
authorAndrew Lunn <andrew@lunn.ch>
Mon, 6 Jan 2020 16:13:52 +0000 (17:13 +0100)
committerDavid S. Miller <davem@davemloft.net>
Tue, 7 Jan 2020 02:30:15 +0000 (18:30 -0800)
Dynamically generate a unique interrupt name for the VTU and ATU,
based on the device name.

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/dsa/mv88e6xxx/chip.h
drivers/net/dsa/mv88e6xxx/global1_atu.c
drivers/net/dsa/mv88e6xxx/global1_vtu.c

index 47fd909fccc2d71cab3d8bb0da0905a5d0cb9ba7..f332cb4b2fbf370a8cb0cead4df2892aca1a343d 100644 (file)
@@ -300,7 +300,9 @@ struct mv88e6xxx_chip {
        char watchdog_irq_name[32];
 
        int atu_prob_irq;
+       char atu_prob_irq_name[32];
        int vtu_prob_irq;
+       char vtu_prob_irq_name[32];
        struct kthread_worker *kworker;
        struct kthread_delayed_work irq_poll_work;
 
index bdcd25560dd280533b4fe814cd2d8ef1a5a76cff..bac9a8a68e500f8e680ff089edf1b877e90591ab 100644 (file)
@@ -425,9 +425,12 @@ int mv88e6xxx_g1_atu_prob_irq_setup(struct mv88e6xxx_chip *chip)
        if (chip->atu_prob_irq < 0)
                return chip->atu_prob_irq;
 
+       snprintf(chip->atu_prob_irq_name, sizeof(chip->atu_prob_irq_name),
+                "mv88e6xxx-%s-g1-atu-prob", dev_name(chip->dev));
+
        err = request_threaded_irq(chip->atu_prob_irq, NULL,
                                   mv88e6xxx_g1_atu_prob_irq_thread_fn,
-                                  IRQF_ONESHOT, "mv88e6xxx-g1-atu-prob",
+                                  IRQF_ONESHOT, chip->atu_prob_irq_name,
                                   chip);
        if (err)
                irq_dispose_mapping(chip->atu_prob_irq);
index 33056a609e96032ed04e02a6ab83ef41b30f0f5a..48390b7b18ad7b9e338b1720b98284c98116de3f 100644 (file)
@@ -631,9 +631,12 @@ int mv88e6xxx_g1_vtu_prob_irq_setup(struct mv88e6xxx_chip *chip)
        if (chip->vtu_prob_irq < 0)
                return chip->vtu_prob_irq;
 
+       snprintf(chip->vtu_prob_irq_name, sizeof(chip->vtu_prob_irq_name),
+                "mv88e6xxx-%s-g1-vtu-prob", dev_name(chip->dev));
+
        err = request_threaded_irq(chip->vtu_prob_irq, NULL,
                                   mv88e6xxx_g1_vtu_prob_irq_thread_fn,
-                                  IRQF_ONESHOT, "mv88e6xxx-g1-vtu-prob",
+                                  IRQF_ONESHOT, chip->vtu_prob_irq_name,
                                   chip);
        if (err)
                irq_dispose_mapping(chip->vtu_prob_irq);