summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2015-12-29 05:22:47 -0700
committerSimon Glass <sjg@chromium.org>2016-01-15 05:39:27 -0700
commit3c8fb12b77849400ffc04737c113a7acff7d7f18 (patch)
tree20cea6ab7247ba34b8233c519ca9d329a2bcf8c7
parent6579385b468b642596d18fc0716681b76e1d0799 (diff)
downloadu-boot-imx-3c8fb12b77849400ffc04737c113a7acff7d7f18.zip
u-boot-imx-3c8fb12b77849400ffc04737c113a7acff7d7f18.tar.gz
u-boot-imx-3c8fb12b77849400ffc04737c113a7acff7d7f18.tar.bz2
dm: spi_flash: Allow the uclass to work without printf()
For SPL we don't really need sprintf() and with tiny-printf this is not available. Allow this to be dropped in SPL when using tiny-printf. Signed-off-by: Simon Glass <sjg@chromium.org>
-rw-r--r--drivers/mtd/spi/sf-uclass.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/mtd/spi/sf-uclass.c b/drivers/mtd/spi/sf-uclass.c
index 95ffad4..19de964 100644
--- a/drivers/mtd/spi/sf-uclass.c
+++ b/drivers/mtd/spi/sf-uclass.c
@@ -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)