mirror of
https://source.denx.de/u-boot/u-boot.git
synced 2026-05-05 04:36:13 +02:00
net: fec_mxc: rewrite fallback MDIO Bus allocation
The code should only be executed if MDIO bus is not assigned. Otherwise the already assigned / allocated bus will be overwritten. Add condition check and simplify the code to make it more readable. Signed-off-by: Markus Niebel <Markus.Niebel@ew.tq-group.com> Signed-off-by: Alexander Stein <alexander.stein@ew.tq-group.com> Signed-off-by: Alexander Feilke <alexander.feilke@ew.tq-group.com>
This commit is contained in:
parent
aafdd85694
commit
fc199c481c
@ -1373,14 +1373,18 @@ static int fecmxc_probe(struct udevice *dev)
|
||||
if (!bus)
|
||||
bus = fec_get_miibus(dev, (ulong)priv->eth, dev_seq(dev));
|
||||
#else
|
||||
if (!bus) {
|
||||
ulong regs = (ulong)priv->eth;
|
||||
|
||||
dm_mii_bus = false;
|
||||
#ifdef CONFIG_FEC_MXC_MDIO_BASE
|
||||
bus = fec_get_miibus(dev, (ulong)CONFIG_FEC_MXC_MDIO_BASE, dev_seq(dev));
|
||||
#else
|
||||
bus = fec_get_miibus(dev, (ulong)priv->eth, dev_seq(dev));
|
||||
dm_mii_bus = false;
|
||||
|
||||
#if defined(CONFIG_FEC_MXC_MDIO_BASE)
|
||||
regs = CONFIG_FEC_MXC_MDIO_BASE;
|
||||
#endif
|
||||
|
||||
bus = fec_get_miibus(dev, regs, dev_seq(dev));
|
||||
}
|
||||
|
||||
#endif /* CONFIG_DM_ETH_PHY */
|
||||
if (!bus) {
|
||||
ret = -ENOMEM;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user