Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

net: phy: fixed_phy: Remove unused seqcount

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

Two years later, commit d2b977939b18 ("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: Ahmed S. Darwish <a.darwish@linutronix.de>
Reviewed-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Ahmed S. Darwish and committed by
David S. Miller
79cbb6bc 11d6011c

+10 -16
+10 -16
drivers/net/phy/fixed_phy.c
··· 19 19 #include <linux/slab.h> 20 20 #include <linux/of.h> 21 21 #include <linux/gpio/consumer.h> 22 - #include <linux/seqlock.h> 23 22 #include <linux/idr.h> 24 23 #include <linux/netdevice.h> 25 24 #include <linux/linkmode.h> ··· 33 34 struct fixed_phy { 34 35 int addr; 35 36 struct phy_device *phydev; 36 - seqcount_t seqcount; 37 37 struct fixed_phy_status status; 38 38 bool no_carrier; 39 39 int (*link_update)(struct net_device *, struct fixed_phy_status *); ··· 78 80 list_for_each_entry(fp, &fmb->phys, node) { 79 81 if (fp->addr == phy_addr) { 80 82 struct fixed_phy_status state; 81 - int s; 82 83 83 - do { 84 - s = read_seqcount_begin(&fp->seqcount); 85 - fp->status.link = !fp->no_carrier; 86 - /* Issue callback if user registered it. */ 87 - if (fp->link_update) 88 - fp->link_update(fp->phydev->attached_dev, 89 - &fp->status); 90 - /* Check the GPIO for change in status */ 91 - fixed_phy_update(fp); 92 - state = fp->status; 93 - } while (read_seqcount_retry(&fp->seqcount, s)); 84 + fp->status.link = !fp->no_carrier; 85 + 86 + /* Issue callback if user registered it. */ 87 + if (fp->link_update) 88 + fp->link_update(fp->phydev->attached_dev, 89 + &fp->status); 90 + 91 + /* Check the GPIO for change in status */ 92 + fixed_phy_update(fp); 93 + state = fp->status; 94 94 95 95 return swphy_read_reg(reg_num, &state); 96 96 } ··· 145 149 fp = kzalloc(sizeof(*fp), GFP_KERNEL); 146 150 if (!fp) 147 151 return -ENOMEM; 148 - 149 - seqcount_init(&fp->seqcount); 150 152 151 153 if (irq != PHY_POLL) 152 154 fmb->mii_bus->irq[phy_addr] = irq;