u32 fifodata[3];
int mac_idx;
- struct reset_control *mdio_reset;
struct clk *clk_mdio;
};
{
struct device *dev = &ag->pdev->dev;
struct net_device *ndev = ag->ndev;
+ struct reset_control *mdio_reset;
static struct mii_bus *mii_bus;
struct device_node *np, *mnp;
int err;
if (!mii_bus)
return -ENOMEM;
- ag->mdio_reset = of_reset_control_get_exclusive(np, "mdio");
- if (IS_ERR(ag->mdio_reset)) {
+ mdio_reset = devm_reset_control_get_exclusive(dev, "mdio");
+ if (IS_ERR(mdio_reset)) {
netif_err(ag, probe, ndev, "Failed to get reset mdio.\n");
- return PTR_ERR(ag->mdio_reset);
+ return PTR_ERR(mdio_reset);
}
mii_bus->name = "ag71xx_mdio";
mii_bus->parent = dev;
snprintf(mii_bus->id, MII_BUS_ID_SIZE, "%s.%d", np->name, ag->mac_idx);
- if (!IS_ERR(ag->mdio_reset)) {
- reset_control_assert(ag->mdio_reset);
+ if (!IS_ERR(mdio_reset)) {
+ reset_control_assert(mdio_reset);
msleep(100);
- reset_control_deassert(ag->mdio_reset);
+ reset_control_deassert(mdio_reset);
msleep(200);
}