9f4cc1c7d9eea0029bfa19344f0cb111be5bd6ca
[openwrt/staging/luka.git] /
1 From 2d490ea00f141384d57c7e18e44b34e94e572b26 Mon Sep 17 00:00:00 2001
2 From: Russell King <rmk+kernel@armlinux.org.uk>
3 Date: Tue, 2 Jan 2018 10:58:32 +0000
4 Subject: [PATCH 293/454] net: phy: use unlocked accessors for indirect MMD
5 accesses
6
7 commit 1b2dea2e6a6e3399e88784d57aea80f4fd5e8956 upstream.
8
9 Use unlocked accessors for indirect MMD accesses to clause 22 PHYs.
10 This permits tracing of these accesses.
11
12 Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
13 Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
14 Signed-off-by: David S. Miller <davem@davemloft.net>
15 ---
16 drivers/net/phy/phy-core.c | 11 ++++++-----
17 1 file changed, 6 insertions(+), 5 deletions(-)
18
19 --- a/drivers/net/phy/phy-core.c
20 +++ b/drivers/net/phy/phy-core.c
21 @@ -193,13 +193,14 @@ static void mmd_phy_indirect(struct mii_
22 u16 regnum)
23 {
24 /* Write the desired MMD Devad */
25 - bus->write(bus, phy_addr, MII_MMD_CTRL, devad);
26 + __mdiobus_write(bus, phy_addr, MII_MMD_CTRL, devad);
27
28 /* Write the desired MMD register address */
29 - bus->write(bus, phy_addr, MII_MMD_DATA, regnum);
30 + __mdiobus_write(bus, phy_addr, MII_MMD_DATA, regnum);
31
32 /* Select the Function : DATA with no post increment */
33 - bus->write(bus, phy_addr, MII_MMD_CTRL, devad | MII_MMD_CTRL_NOINCR);
34 + __mdiobus_write(bus, phy_addr, MII_MMD_CTRL,
35 + devad | MII_MMD_CTRL_NOINCR);
36 }
37
38 /**
39 @@ -232,7 +233,7 @@ int phy_read_mmd(struct phy_device *phyd
40 mmd_phy_indirect(bus, phy_addr, devad, regnum);
41
42 /* Read the content of the MMD's selected register */
43 - val = bus->read(bus, phy_addr, MII_MMD_DATA);
44 + val = __mdiobus_read(bus, phy_addr, MII_MMD_DATA);
45 mutex_unlock(&bus->mdio_lock);
46 }
47 return val;
48 @@ -271,7 +272,7 @@ int phy_write_mmd(struct phy_device *phy
49 mmd_phy_indirect(bus, phy_addr, devad, regnum);
50
51 /* Write the data into MMD's selected register */
52 - bus->write(bus, phy_addr, MII_MMD_DATA, val);
53 + __mdiobus_write(bus, phy_addr, MII_MMD_DATA, val);
54 mutex_unlock(&bus->mdio_lock);
55
56 ret = 0;