mirror of
https://github.com/Fishwaldo/u-boot.git
synced 2025-03-30 19:11:37 +00:00
net: sh_eth: Fix DT base address fetching
Drop the whole map/unmap_physmem stuff and just use the address already obtained from DT in ofdata_to_platdata(), instead of repeating that, wrongly, in probe. Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com> Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org> Cc: Joe Hershberger <joe.hershberger@ni.com>
This commit is contained in:
parent
5262767ded
commit
5abcbd7847
1 changed files with 4 additions and 10 deletions
|
@ -675,7 +675,7 @@ struct sh_ether_priv {
|
||||||
struct sh_eth_dev shdev;
|
struct sh_eth_dev shdev;
|
||||||
|
|
||||||
struct mii_dev *bus;
|
struct mii_dev *bus;
|
||||||
void __iomem *iobase;
|
phys_addr_t iobase;
|
||||||
struct clk clk;
|
struct clk clk;
|
||||||
struct gpio_desc reset_gpio;
|
struct gpio_desc reset_gpio;
|
||||||
};
|
};
|
||||||
|
@ -811,15 +811,13 @@ static int sh_ether_probe(struct udevice *udev)
|
||||||
struct sh_ether_priv *priv = dev_get_priv(udev);
|
struct sh_ether_priv *priv = dev_get_priv(udev);
|
||||||
struct sh_eth_dev *eth = &priv->shdev;
|
struct sh_eth_dev *eth = &priv->shdev;
|
||||||
struct mii_dev *mdiodev;
|
struct mii_dev *mdiodev;
|
||||||
void __iomem *iobase;
|
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
iobase = map_physmem(pdata->iobase, 0x1000, MAP_NOCACHE);
|
priv->iobase = pdata->iobase;
|
||||||
priv->iobase = iobase;
|
|
||||||
|
|
||||||
ret = clk_get_by_index(udev, 0, &priv->clk);
|
ret = clk_get_by_index(udev, 0, &priv->clk);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
goto err_mdio_alloc;
|
return ret;
|
||||||
|
|
||||||
gpio_request_by_name(udev, "reset-gpios", 0, &priv->reset_gpio,
|
gpio_request_by_name(udev, "reset-gpios", 0, &priv->reset_gpio,
|
||||||
GPIOD_IS_OUT);
|
GPIOD_IS_OUT);
|
||||||
|
@ -827,7 +825,7 @@ static int sh_ether_probe(struct udevice *udev)
|
||||||
mdiodev = mdio_alloc();
|
mdiodev = mdio_alloc();
|
||||||
if (!mdiodev) {
|
if (!mdiodev) {
|
||||||
ret = -ENOMEM;
|
ret = -ENOMEM;
|
||||||
goto err_mdio_alloc;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
mdiodev->read = bb_miiphy_read;
|
mdiodev->read = bb_miiphy_read;
|
||||||
|
@ -850,8 +848,6 @@ static int sh_ether_probe(struct udevice *udev)
|
||||||
|
|
||||||
err_mdio_register:
|
err_mdio_register:
|
||||||
mdio_free(mdiodev);
|
mdio_free(mdiodev);
|
||||||
err_mdio_alloc:
|
|
||||||
unmap_physmem(priv->iobase, MAP_NOCACHE);
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -868,8 +864,6 @@ static int sh_ether_remove(struct udevice *udev)
|
||||||
if (dm_gpio_is_valid(&priv->reset_gpio))
|
if (dm_gpio_is_valid(&priv->reset_gpio))
|
||||||
dm_gpio_free(udev, &priv->reset_gpio);
|
dm_gpio_free(udev, &priv->reset_gpio);
|
||||||
|
|
||||||
unmap_physmem(priv->iobase, MAP_NOCACHE);
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue