]> Git Repo - J-u-boot.git/blobdiff - drivers/spi/davinci_spi.c
treewide: Simply conditions with the new OF_REAL
[J-u-boot.git] / drivers / spi / davinci_spi.c
index ea088ebd2cb6a619befae8e8ada9d41eab35add4..0ee6171108a8772bbe4060f13c3ef3a09f05031b 100644 (file)
@@ -12,6 +12,7 @@
 #include <log.h>
 #include <spi.h>
 #include <malloc.h>
+#include <asm/global_data.h>
 #include <asm/io.h>
 #include <asm/arch/hardware.h>
 #include <dm.h>
@@ -383,17 +384,17 @@ static const struct dm_spi_ops davinci_spi_ops = {
 static int davinci_spi_probe(struct udevice *bus)
 {
        struct davinci_spi_slave *ds = dev_get_priv(bus);
-       struct davinci_spi_plat *plat = bus->plat;
+       struct davinci_spi_plat *plat = dev_get_plat(bus);
        ds->regs = plat->regs;
        ds->num_cs = plat->num_cs;
 
        return 0;
 }
 
-#if CONFIG_IS_ENABLED(OF_CONTROL) && !CONFIG_IS_ENABLED(OF_PLATDATA)
+#if CONFIG_IS_ENABLED(OF_REAL)
 static int davinci_ofdata_to_platadata(struct udevice *bus)
 {
-       struct davinci_spi_plat *plat = bus->plat;
+       struct davinci_spi_plat *plat = dev_get_plat(bus);
        fdt_addr_t addr;
 
        addr = dev_read_addr(bus);
@@ -417,7 +418,7 @@ static const struct udevice_id davinci_spi_ids[] = {
 U_BOOT_DRIVER(davinci_spi) = {
        .name = "davinci_spi",
        .id = UCLASS_SPI,
-#if CONFIG_IS_ENABLED(OF_CONTROL) && !CONFIG_IS_ENABLED(OF_PLATDATA)
+#if CONFIG_IS_ENABLED(OF_REAL)
        .of_match = davinci_spi_ids,
        .of_to_plat = davinci_ofdata_to_platadata,
        .plat_auto      = sizeof(struct davinci_spi_plat),
This page took 0.021154 seconds and 4 git commands to generate.