return 0;
}
-static int sunxi_emac_board_setup(struct emac_eth_dev *priv)
+static int sunxi_emac_board_setup(struct udevice *dev,
+ struct emac_eth_dev *priv)
{
struct sunxi_sramc_regs *sram =
(struct sunxi_sramc_regs *)SUNXI_SRAMC_BASE;
static int sunxi_emac_eth_start(struct udevice *dev)
{
- struct eth_pdata *pdata = dev_get_platdata(dev);
+ struct eth_pdata *pdata = dev_get_plat(dev);
- return _sunxi_emac_eth_init(dev->priv, pdata->enetaddr);
+ return _sunxi_emac_eth_init(dev_get_priv(dev), pdata->enetaddr);
}
static int sunxi_emac_eth_send(struct udevice *dev, void *packet, int length)
static int sunxi_emac_eth_probe(struct udevice *dev)
{
- struct eth_pdata *pdata = dev_get_platdata(dev);
+ struct eth_pdata *pdata = dev_get_plat(dev);
struct emac_eth_dev *priv = dev_get_priv(dev);
int ret;
return ret;
}
- ret = sunxi_emac_board_setup(priv);
+ ret = sunxi_emac_board_setup(dev, priv);
if (ret)
return ret;
.stop = sunxi_emac_eth_stop,
};
-static int sunxi_emac_eth_ofdata_to_platdata(struct udevice *dev)
+static int sunxi_emac_eth_of_to_plat(struct udevice *dev)
{
- struct eth_pdata *pdata = dev_get_platdata(dev);
+ struct eth_pdata *pdata = dev_get_plat(dev);
- pdata->iobase = devfdt_get_addr(dev);
+ pdata->iobase = dev_read_addr(dev);
return 0;
}
.name = "eth_sunxi_emac",
.id = UCLASS_ETH,
.of_match = sunxi_emac_eth_ids,
- .ofdata_to_platdata = sunxi_emac_eth_ofdata_to_platdata,
+ .of_to_plat = sunxi_emac_eth_of_to_plat,
.probe = sunxi_emac_eth_probe,
.ops = &sunxi_emac_eth_ops,
- .priv_auto_alloc_size = sizeof(struct emac_eth_dev),
- .platdata_auto_alloc_size = sizeof(struct eth_pdata),
+ .priv_auto = sizeof(struct emac_eth_dev),
+ .plat_auto = sizeof(struct eth_pdata),
};