X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=drivers%2Fnet%2Faltera_tse.c;h=93b26da39261093fbc7dfd7db9dffeb5d63f6fed;hb=60c7facfc965af6ff8ea14ee26c9d49cd2d0ec22;hp=5692fe9d4a3b54cf7a7dd08d40eaea5aaf057f5a;hpb=ade766acfb27b1cfe175cd83f22db80dc5b5d789;p=oweals%2Fu-boot.git diff --git a/drivers/net/altera_tse.c b/drivers/net/altera_tse.c index 5692fe9d4a..93b26da392 100644 --- a/drivers/net/altera_tse.c +++ b/drivers/net/altera_tse.c @@ -9,14 +9,16 @@ * published by the Free Software Foundation. */ #include +#include #include #include #include +#include #include #include #include #include -#include +#include #include #include "altera_tse.h" @@ -417,7 +419,7 @@ static int tse_mdio_init(const char *name, struct altera_tse_priv *priv) bus->read = tse_mdio_read; bus->write = tse_mdio_write; - snprintf(bus->name, sizeof(bus->name), name); + snprintf(bus->name, sizeof(bus->name), "%s", name); bus->priv = (void *)priv; @@ -576,7 +578,7 @@ static int altera_tse_probe(struct udevice *dev) struct eth_pdata *pdata = dev_get_platdata(dev); struct altera_tse_priv *priv = dev_get_priv(dev); void *blob = (void *)gd->fdt_blob; - int node = dev->of_offset; + int node = dev_of_offset(dev); const char *list, *end; const fdt32_t *cell; void *base, *desc_mem = NULL; @@ -595,7 +597,7 @@ static int altera_tse_probe(struct udevice *dev) * match with reg-names. */ parent = fdt_parent_offset(blob, node); - of_bus_default_count_cells(blob, parent, &addrc, &sizec); + fdt_support_default_count_cells(blob, parent, &addrc, &sizec); list = fdt_getprop(blob, node, "reg-names", &len); if (!list) return -ENOENT; @@ -608,7 +610,7 @@ static int altera_tse_probe(struct udevice *dev) addr = fdt_translate_address((void *)blob, node, cell + idx); size = fdt_addr_to_cpu(cell[idx + addrc]); - base = ioremap(addr, size); + base = map_physmem(addr, size, MAP_NOCACHE); len = strlen(list); if (strcmp(list, "control_port") == 0) priv->mac_dev = base; @@ -676,7 +678,8 @@ static int altera_tse_ofdata_to_platdata(struct udevice *dev) const char *phy_mode; pdata->phy_interface = -1; - phy_mode = fdt_getprop(gd->fdt_blob, dev->of_offset, "phy-mode", NULL); + phy_mode = fdt_getprop(gd->fdt_blob, dev_of_offset(dev), "phy-mode", + NULL); if (phy_mode) pdata->phy_interface = phy_get_interface_by_name(phy_mode); if (pdata->phy_interface == -1) {