net: fec_mxc: simplify fec_get_miibus
No need to provide two prototype for this function. Use ulong for the first parameter, then this function could be shared for DM/non DM case. Signed-off-by: Peng Fan <peng.fan@nxp.com> Acked-by: Joe Hershberger <joe.hershberger@ni.com>
This commit is contained in:
parent
0cb58cfb87
commit
4266aac456
|
|
@ -1011,18 +1011,9 @@ static void fec_free_descs(struct fec_priv *fec)
|
||||||
free(fec->tbd_base);
|
free(fec->tbd_base);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_DM_ETH
|
struct mii_dev *fec_get_miibus(ulong base_addr, int dev_id)
|
||||||
struct mii_dev *fec_get_miibus(struct udevice *dev, int dev_id)
|
|
||||||
#else
|
|
||||||
struct mii_dev *fec_get_miibus(uint32_t base_addr, int dev_id)
|
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
#ifdef CONFIG_DM_ETH
|
struct ethernet_regs *eth = (struct ethernet_regs *)base_addr;
|
||||||
struct fec_priv *priv = dev_get_priv(dev);
|
|
||||||
struct ethernet_regs *eth = priv->eth;
|
|
||||||
#else
|
|
||||||
struct ethernet_regs *eth = (struct ethernet_regs *)(ulong)base_addr;
|
|
||||||
#endif
|
|
||||||
struct mii_dev *bus;
|
struct mii_dev *bus;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
|
|
@ -1164,7 +1155,7 @@ int fecmxc_initialize_multi(bd_t *bd, int dev_id, int phy_id, uint32_t addr)
|
||||||
base_mii = addr;
|
base_mii = addr;
|
||||||
#endif
|
#endif
|
||||||
debug("eth_init: fec_probe(bd, %i, %i) @ %08x\n", dev_id, phy_id, addr);
|
debug("eth_init: fec_probe(bd, %i, %i) @ %08x\n", dev_id, phy_id, addr);
|
||||||
bus = fec_get_miibus(base_mii, dev_id);
|
bus = fec_get_miibus((ulong)base_mii, dev_id);
|
||||||
if (!bus)
|
if (!bus)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
#ifdef CONFIG_PHYLIB
|
#ifdef CONFIG_PHYLIB
|
||||||
|
|
@ -1282,7 +1273,7 @@ static int fecmxc_probe(struct udevice *dev)
|
||||||
fec_reg_setup(priv);
|
fec_reg_setup(priv);
|
||||||
priv->dev_id = (dev_id == -1) ? 0 : dev_id;
|
priv->dev_id = (dev_id == -1) ? 0 : dev_id;
|
||||||
|
|
||||||
bus = fec_get_miibus(dev, dev_id);
|
bus = fec_get_miibus((ulong)priv->eth, dev_id);
|
||||||
if (!bus) {
|
if (!bus) {
|
||||||
ret = -ENOMEM;
|
ret = -ENOMEM;
|
||||||
goto err_mii;
|
goto err_mii;
|
||||||
|
|
|
||||||
|
|
@ -119,11 +119,7 @@ static inline int pci_eth_init(bd_t *bis)
|
||||||
return num;
|
return num;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_DM_ETH
|
struct mii_dev *fec_get_miibus(ulong base_addr, int dev_id);
|
||||||
struct mii_dev *fec_get_miibus(struct udevice *dev, int dev_id);
|
|
||||||
#else
|
|
||||||
struct mii_dev *fec_get_miibus(uint32_t base_addr, int dev_id);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef CONFIG_PHYLIB
|
#ifdef CONFIG_PHYLIB
|
||||||
struct phy_device;
|
struct phy_device;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue