rockchip: use dummy byte only enable OF_PLATDATA
[oweals/u-boot.git] / drivers / mtd / spi / sf-uclass.c
index 72e0f6b3fb1e591124ae2bfc879ac3685d6405b5..19de964e6121c53642d07a8c28b8afde8f9d137c 100644 (file)
@@ -46,7 +46,7 @@ struct spi_flash *spi_flash_probe(unsigned int bus, unsigned int cs,
 
 void spi_flash_free(struct spi_flash *flash)
 {
-       spi_flash_remove(flash->spi->dev);
+       device_remove(flash->spi->dev);
 }
 
 int spi_flash_probe_bus_cs(unsigned int busnum, unsigned int cs,
@@ -55,11 +55,17 @@ int spi_flash_probe_bus_cs(unsigned int busnum, unsigned int cs,
 {
        struct spi_slave *slave;
        struct udevice *bus;
-       char name[30], *str;
+       char *str;
        int ret;
 
+#if defined(CONFIG_SPL_BUILD) && defined(CONFIG_USE_TINY_PRINTF)
+       str = "spi_flash";
+#else
+       char name[30];
+
        snprintf(name, sizeof(name), "spi_flash@%d:%d", busnum, cs);
        str = strdup(name);
+#endif
        ret = spi_get_bus_and_cs(busnum, cs, max_hz, spi_mode,
                                  "spi_flash_std", str, &bus, &slave);
        if (ret)
@@ -69,11 +75,6 @@ int spi_flash_probe_bus_cs(unsigned int busnum, unsigned int cs,
        return 0;
 }
 
-int spi_flash_remove(struct udevice *dev)
-{
-       return device_remove(dev);
-}
-
 static int spi_flash_post_bind(struct udevice *dev)
 {
 #if defined(CONFIG_NEEDS_MANUAL_RELOC)