Skip to content

Commit

Permalink
dm: spi_flash: Allow the uclass to work without printf()
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
sjg20 committed Jan 15, 2016
1 parent 6579385 commit 3c8fb12
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion drivers/mtd/spi/sf-uclass.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 3c8fb12

Please sign in to comment.