]> git.sur5r.net Git - u-boot/blobdiff - drivers/spi/fsl_dspi.c
Merge git://git.denx.de/u-boot-spi
[u-boot] / drivers / spi / fsl_dspi.c
index 3881b2e8a54630938667d08ca911a5f06854542d..42086197d9891b15e21b10eacc3efb988ffccc4f 100644 (file)
@@ -9,6 +9,8 @@
  *
  * SPDX-License-Identifier:    GPL-2.0+
  */
+
+#include <common.h>
 #include <dm.h>
 #include <errno.h>
 #include <common.h>
@@ -24,7 +26,7 @@
 DECLARE_GLOBAL_DATA_PTR;
 
 /* fsl_dspi_platdata flags */
-#define DSPI_FLAG_REGMAP_ENDIAN_BIG    (1 << 0)
+#define DSPI_FLAG_REGMAP_ENDIAN_BIG    BIT(0)
 
 /* idle data value */
 #define DSPI_IDLE_VAL                  0x0
@@ -594,7 +596,7 @@ static int fsl_dspi_claim_bus(struct udevice *dev)
 
        priv = dev_get_priv(bus);
 
-       /* processor special prepartion work */
+       /* processor special preparation work */
        cpu_dspi_claim_bus(bus->seq, slave_plat->cs);
 
        /* configure transfer mode */
@@ -646,7 +648,7 @@ static int fsl_dspi_ofdata_to_platdata(struct udevice *bus)
        fdt_addr_t addr;
        struct fsl_dspi_platdata *plat = bus->platdata;
        const void *blob = gd->fdt_blob;
-       int node = bus->of_offset;
+       int node = dev_of_offset(bus);
 
        if (fdtdec_get_bool(blob, node, "big-endian"))
                plat->flags |= DSPI_FLAG_REGMAP_ENDIAN_BIG;
@@ -654,7 +656,7 @@ static int fsl_dspi_ofdata_to_platdata(struct udevice *bus)
        plat->num_chipselect =
                fdtdec_get_int(blob, node, "num-cs", FSL_DSPI_MAX_CHIPSELECT);
 
-       addr = fdtdec_get_addr(blob, node, "reg");
+       addr = devfdt_get_addr(bus);
        if (addr == FDT_ADDR_T_NONE) {
                debug("DSPI: Can't get base address or size\n");
                return -ENOMEM;