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

net: phylink: Convert some users of mdiobus_* to mdiodev_*

This refactors the phylink pcs helper functions to use mdiobus_* instead
of mdiodev_*.

Signed-off-by: Sean Anderson <sean.anderson@seco.com>
Reviewed-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Sean Anderson and committed by
David S. Miller
c8fb89a7 0ebecb26

+7 -16
+7 -16
drivers/net/phy/phylink.c
··· 2542 2542 void phylink_mii_c22_pcs_get_state(struct mdio_device *pcs, 2543 2543 struct phylink_link_state *state) 2544 2544 { 2545 - struct mii_bus *bus = pcs->bus; 2546 - int addr = pcs->addr; 2547 2545 int bmsr, lpa; 2548 2546 2549 - bmsr = mdiobus_read(bus, addr, MII_BMSR); 2550 - lpa = mdiobus_read(bus, addr, MII_LPA); 2547 + bmsr = mdiodev_read(pcs, MII_BMSR); 2548 + lpa = mdiodev_read(pcs, MII_LPA); 2551 2549 if (bmsr < 0 || lpa < 0) { 2552 2550 state->link = false; 2553 2551 return; ··· 2601 2603 phy_interface_t interface, 2602 2604 const unsigned long *advertising) 2603 2605 { 2604 - struct mii_bus *bus = pcs->bus; 2605 - int addr = pcs->addr; 2606 2606 u16 adv; 2607 2607 2608 2608 switch (interface) { ··· 2614 2618 advertising)) 2615 2619 adv |= ADVERTISE_1000XPSE_ASYM; 2616 2620 2617 - return mdiobus_modify_changed(bus, addr, MII_ADVERTISE, 2618 - 0xffff, adv); 2621 + return mdiodev_modify_changed(pcs, MII_ADVERTISE, 0xffff, adv); 2619 2622 2620 2623 case PHY_INTERFACE_MODE_SGMII: 2621 - return mdiobus_modify_changed(bus, addr, MII_ADVERTISE, 2622 - 0xffff, 0x0001); 2624 + return mdiodev_modify_changed(pcs, MII_ADVERTISE, 0xffff, 0x0001); 2623 2625 2624 2626 default: 2625 2627 /* Nothing to do for other modes */ ··· 2660 2666 else 2661 2667 bmcr = 0; 2662 2668 2663 - ret = mdiobus_modify(pcs->bus, pcs->addr, MII_BMCR, 2664 - BMCR_ANENABLE | BMCR_ISOLATE, bmcr); 2669 + ret = mdiodev_modify(pcs, MII_BMCR, BMCR_ANENABLE | BMCR_ISOLATE, bmcr); 2665 2670 if (ret < 0) 2666 2671 return ret; 2667 2672 ··· 2681 2688 */ 2682 2689 void phylink_mii_c22_pcs_an_restart(struct mdio_device *pcs) 2683 2690 { 2684 - struct mii_bus *bus = pcs->bus; 2685 - int val, addr = pcs->addr; 2691 + int val = mdiodev_read(pcs, MII_BMCR); 2686 2692 2687 - val = mdiobus_read(bus, addr, MII_BMCR); 2688 2693 if (val >= 0) { 2689 2694 val |= BMCR_ANRESTART; 2690 2695 2691 - mdiobus_write(bus, addr, MII_BMCR, val); 2696 + mdiodev_write(pcs, MII_BMCR, val); 2692 2697 } 2693 2698 } 2694 2699 EXPORT_SYMBOL_GPL(phylink_mii_c22_pcs_an_restart);