Commit 79cbb6bc authored by Ahmed S. Darwish's avatar Ahmed S. Darwish Committed by David S. Miller

net: phy: fixed_phy: Remove unused seqcount

Commit bf7afb29 ("phy: improve safety of fixed-phy MII register
reading") protected the fixed PHY status with a sequence counter.

Two years later, commit d2b97793 ("net: phy: fixed-phy: remove
fixed_phy_update_state()") removed the sequence counter's write side
critical section -- neutralizing its read side retry loop.

Remove the unused seqcount.
Signed-off-by: default avatarAhmed S. Darwish <a.darwish@linutronix.de>
Reviewed-by: default avatarSebastian Andrzej Siewior <bigeasy@linutronix.de>
Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 11d6011c
...@@ -19,7 +19,6 @@ ...@@ -19,7 +19,6 @@
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/of.h> #include <linux/of.h>
#include <linux/gpio/consumer.h> #include <linux/gpio/consumer.h>
#include <linux/seqlock.h>
#include <linux/idr.h> #include <linux/idr.h>
#include <linux/netdevice.h> #include <linux/netdevice.h>
#include <linux/linkmode.h> #include <linux/linkmode.h>
...@@ -34,7 +33,6 @@ struct fixed_mdio_bus { ...@@ -34,7 +33,6 @@ struct fixed_mdio_bus {
struct fixed_phy { struct fixed_phy {
int addr; int addr;
struct phy_device *phydev; struct phy_device *phydev;
seqcount_t seqcount;
struct fixed_phy_status status; struct fixed_phy_status status;
bool no_carrier; bool no_carrier;
int (*link_update)(struct net_device *, struct fixed_phy_status *); int (*link_update)(struct net_device *, struct fixed_phy_status *);
...@@ -80,19 +78,17 @@ static int fixed_mdio_read(struct mii_bus *bus, int phy_addr, int reg_num) ...@@ -80,19 +78,17 @@ static int fixed_mdio_read(struct mii_bus *bus, int phy_addr, int reg_num)
list_for_each_entry(fp, &fmb->phys, node) { list_for_each_entry(fp, &fmb->phys, node) {
if (fp->addr == phy_addr) { if (fp->addr == phy_addr) {
struct fixed_phy_status state; struct fixed_phy_status state;
int s;
fp->status.link = !fp->no_carrier;
do {
s = read_seqcount_begin(&fp->seqcount); /* Issue callback if user registered it. */
fp->status.link = !fp->no_carrier; if (fp->link_update)
/* Issue callback if user registered it. */ fp->link_update(fp->phydev->attached_dev,
if (fp->link_update) &fp->status);
fp->link_update(fp->phydev->attached_dev,
&fp->status); /* Check the GPIO for change in status */
/* Check the GPIO for change in status */ fixed_phy_update(fp);
fixed_phy_update(fp); state = fp->status;
state = fp->status;
} while (read_seqcount_retry(&fp->seqcount, s));
return swphy_read_reg(reg_num, &state); return swphy_read_reg(reg_num, &state);
} }
...@@ -150,8 +146,6 @@ static int fixed_phy_add_gpiod(unsigned int irq, int phy_addr, ...@@ -150,8 +146,6 @@ static int fixed_phy_add_gpiod(unsigned int irq, int phy_addr,
if (!fp) if (!fp)
return -ENOMEM; return -ENOMEM;
seqcount_init(&fp->seqcount);
if (irq != PHY_POLL) if (irq != PHY_POLL)
fmb->mii_bus->irq[phy_addr] = irq; fmb->mii_bus->irq[phy_addr] = irq;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment