Skip to content

Commit

Permalink
net: mdio: rename mdio_device reset to reset_gpio
Browse files Browse the repository at this point in the history
This renames the GPIO reset of mdio devices from 'reset' to
'reset_gpio' to better differentiate between GPIO and
reset-controller driven reset line.

Signed-off-by: David Bauer <[email protected]>
Reviewed-by: Andrew Lunn <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
blocktrron authored and davem330 committed Apr 19, 2019
1 parent 71dd6c0 commit 6110ed2
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion drivers/net/phy/at803x.c
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ static void at803x_link_change_notify(struct phy_device *phydev)
* in the FIFO. In such cases, the FIFO enters an error mode it
* cannot recover from by software.
*/
if (phydev->state == PHY_NOLINK && phydev->mdio.reset) {
if (phydev->state == PHY_NOLINK && phydev->mdio.reset_gpio) {
struct at803x_context context;

at803x_context_save(phydev, &context);
Expand Down
6 changes: 3 additions & 3 deletions drivers/net/phy/mdio_bus.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ static int mdiobus_register_gpiod(struct mdio_device *mdiodev)
return PTR_ERR(gpiod);
}

mdiodev->reset = gpiod;
mdiodev->reset_gpio = gpiod;

return 0;
}
Expand Down Expand Up @@ -469,8 +469,8 @@ void mdiobus_unregister(struct mii_bus *bus)
if (!mdiodev)
continue;

if (mdiodev->reset)
gpiod_put(mdiodev->reset);
if (mdiodev->reset_gpio)
gpiod_put(mdiodev->reset_gpio);

mdiodev->device_remove(mdiodev);
mdiodev->device_free(mdiodev);
Expand Down
6 changes: 3 additions & 3 deletions drivers/net/phy/mdio_device.c
Original file line number Diff line number Diff line change
Expand Up @@ -117,11 +117,11 @@ void mdio_device_reset(struct mdio_device *mdiodev, int value)
{
unsigned int d;

if (!mdiodev->reset && !mdiodev->reset_ctrl)
if (!mdiodev->reset_gpio && !mdiodev->reset_ctrl)
return;

if (mdiodev->reset)
gpiod_set_value(mdiodev->reset, value);
if (mdiodev->reset_gpio)
gpiod_set_value(mdiodev->reset_gpio, value);

if (mdiodev->reset_ctrl) {
if (value)
Expand Down
2 changes: 1 addition & 1 deletion include/linux/mdio.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ struct mdio_device {
/* Bus address of the MDIO device (0-31) */
int addr;
int flags;
struct gpio_desc *reset;
struct gpio_desc *reset_gpio;
struct reset_control *reset_ctrl;
unsigned int reset_assert_delay;
unsigned int reset_deassert_delay;
Expand Down

0 comments on commit 6110ed2

Please sign in to comment.