]> git.sur5r.net Git - u-boot/blobdiff - drivers/net/tsec.c
spl: use different BOARD_INIT MACRO for spl and tpl
[u-boot] / drivers / net / tsec.c
index 025e7a76f1262876d8aec7819e6a62831a51f31c..18e7a83d0f36cbbe9a073c9a5e53a264f4ef35e1 100644 (file)
@@ -16,7 +16,7 @@
 #include <command.h>
 #include <tsec.h>
 #include <fsl_mdio.h>
-#include <asm/errno.h>
+#include <linux/errno.h>
 #include <asm/processor.h>
 #include <asm/io.h>
 
@@ -710,7 +710,7 @@ static int tsec_initialize(bd_t *bis, struct tsec_info_struct *tsec_info)
        priv->tbiaddr = CONFIG_SYS_TBIPA_VALUE;
        priv->flags = tsec_info->flags;
 
-       sprintf(dev->name, tsec_info->devname);
+       strcpy(dev->name, tsec_info->devname);
        priv->interface = tsec_info->interface;
        priv->bus = miiphy_get_dev_by_name(tsec_info->mii_devname);
        priv->dev = dev;
@@ -780,10 +780,10 @@ int tsec_probe(struct udevice *dev)
        const char *phy_mode;
        int ret;
 
-       pdata->iobase = (phys_addr_t)dev_get_addr(dev);
+       pdata->iobase = (phys_addr_t)devfdt_get_addr(dev);
        priv->regs = (struct tsec *)pdata->iobase;
 
-       offset = fdtdec_lookup_phandle(gd->fdt_blob, dev->of_offset,
+       offset = fdtdec_lookup_phandle(gd->fdt_blob, dev_of_offset(dev),
                                       "phy-handle");
        if (offset > 0) {
                reg = fdtdec_get_int(gd->fdt_blob, offset, "reg", 0);
@@ -802,7 +802,7 @@ int tsec_probe(struct udevice *dev)
                return -ENOENT;
        }
 
-       offset = fdtdec_lookup_phandle(gd->fdt_blob, dev->of_offset,
+       offset = fdtdec_lookup_phandle(gd->fdt_blob, dev_of_offset(dev),
                                       "tbi-handle");
        if (offset > 0) {
                reg = fdtdec_get_int(gd->fdt_blob, offset, "reg",
@@ -812,7 +812,7 @@ int tsec_probe(struct udevice *dev)
                priv->tbiaddr = CONFIG_SYS_TBIPA_VALUE;
        }
 
-       phy_mode = fdt_getprop(gd->fdt_blob, dev->of_offset,
+       phy_mode = fdt_getprop(gd->fdt_blob, dev_of_offset(dev),
                               "phy-connection-type", NULL);
        if (phy_mode)
                pdata->phy_interface = phy_get_interface_by_name(phy_mode);