]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
net: dsa: mv88e6xxx: Unique SERDES interrupt names
authorAndrew Lunn <andrew@lunn.ch>
Mon, 6 Jan 2020 16:13:49 +0000 (17:13 +0100)
committerDavid S. Miller <davem@davemloft.net>
Tue, 7 Jan 2020 02:30:14 +0000 (18:30 -0800)
Dynamically generate a unique SERDES interrupt name, based on the
device name and the port the SERDES is for. For example:

 95:          3  mv88e6xxx-g2   9 Edge      mv88e6xxx-0.2:00-serdes-9
 96:          0  mv88e6xxx-g2  10 Edge      mv88e6xxx-0.2:00-serdes-10

The 0.2:00 indicates the switch and -9 indicates port 9.

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

index e21e460c11f774463b8eee91951b7dfd85727d90..99816ca9e5e46b52fa139f0da2440d43b2aa6659 100644 (file)
@@ -2306,10 +2306,14 @@ static int mv88e6xxx_serdes_irq_request(struct mv88e6xxx_chip *chip, int port,
        if (!irq)
                return 0;
 
+       snprintf(dev_id->serdes_irq_name, sizeof(dev_id->serdes_irq_name),
+                "mv88e6xxx-%s-serdes-%d", dev_name(chip->dev), port);
+
        /* Requesting the IRQ will trigger IRQ callbacks, so release the lock */
        mv88e6xxx_reg_unlock(chip);
        err = request_threaded_irq(irq, NULL, mv88e6xxx_serdes_irq_thread_fn,
-                                  IRQF_ONESHOT, "mv88e6xxx-serdes", dev_id);
+                                  IRQF_ONESHOT, dev_id->serdes_irq_name,
+                                  dev_id);
        mv88e6xxx_reg_lock(chip);
        if (err)
                return err;
index 03aec58513abf3bb74327b9a4cd4fbcb60ad09ec..b7613ef600d275b321fb64eeb9a51227333997e1 100644 (file)
@@ -236,6 +236,7 @@ struct mv88e6xxx_port {
        bool mirror_ingress;
        bool mirror_egress;
        unsigned int serdes_irq;
+       char serdes_irq_name[32];
 };
 
 struct mv88e6xxx_chip {