summaryrefslogtreecommitdiff
path: root/drivers/net/phy
diff options
context:
space:
mode:
authorMarek Vasut <[email protected]>2025-03-02 02:24:44 +0100
committerMarek Vasut <[email protected]>2025-03-11 23:05:57 +0100
commitc5318bdcf80965fddccf68146c7838816aedb154 (patch)
tree13c10eab9e7c685ea1119594484f093def3c3375 /drivers/net/phy
parent3374d3783a575db7dd2dc9f2f74b7523e547b130 (diff)
net: miiphybb: Pass struct bb_miiphy_bus_ops directly to bb_miiphy_read/write()
The access to struct bb_miiphy_bus_ops via ops pointer in struct bb_miiphy_bus is not necessary with wrappers added in previous patch. Pass the ops pointer directly to both bb_miiphy_read() and bb_miiphy_write() functions. Signed-off-by: Marek Vasut <[email protected]> Reviewed-by: Paul Barker <[email protected]>
Diffstat (limited to 'drivers/net/phy')
-rw-r--r--drivers/net/phy/miiphybb.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/drivers/net/phy/miiphybb.c b/drivers/net/phy/miiphybb.c
index e6106341eb3..9481ba76f51 100644
--- a/drivers/net/phy/miiphybb.c
+++ b/drivers/net/phy/miiphybb.c
@@ -126,21 +126,19 @@ static void miiphy_pre(struct bb_miiphy_bus *bus, const struct bb_miiphy_bus_ops
* Returns:
* 0 on success
*/
-int bb_miiphy_read(struct mii_dev *miidev, int addr, int devad, int reg)
+int bb_miiphy_read(struct mii_dev *miidev, const struct bb_miiphy_bus_ops *ops,
+ int addr, int devad, int reg)
{
unsigned short rdreg; /* register working value */
int v;
int j; /* counter */
struct bb_miiphy_bus *bus;
- const struct bb_miiphy_bus_ops *ops;
bus = bb_miiphy_getbus(miidev);
if (bus == NULL) {
return -1;
}
- ops = bus->ops;
-
miiphy_pre(bus, ops, 1, addr, reg);
/* tri-state our MDIO I/O pin so we can read */
@@ -198,11 +196,10 @@ int bb_miiphy_read(struct mii_dev *miidev, int addr, int devad, int reg)
* Returns:
* 0 on success
*/
-int bb_miiphy_write(struct mii_dev *miidev, int addr, int devad, int reg,
- u16 value)
+int bb_miiphy_write(struct mii_dev *miidev, const struct bb_miiphy_bus_ops *ops,
+ int addr, int devad, int reg, u16 value)
{
struct bb_miiphy_bus *bus;
- const struct bb_miiphy_bus_ops *ops;
int j; /* counter */
bus = bb_miiphy_getbus(miidev);
@@ -211,8 +208,6 @@ int bb_miiphy_write(struct mii_dev *miidev, int addr, int devad, int reg,
return -1;
}
- ops = bus->ops;
-
miiphy_pre(bus, ops, 0, addr, reg);
/* send the turnaround (10) */