diff options
author | Julius Werner <jwerner@chromium.org> | 2021-09-10 19:08:48 -0700 |
---|---|---|
committer | Felix Held <felix-coreboot@felixheld.de> | 2021-09-13 13:49:00 +0000 |
commit | c1b98a43ae3493f3c91e432dfa49207a3b6a4ac4 (patch) | |
tree | e7bd6117597c5a0be6de80b6047a58f33bd8dfe8 /src | |
parent | 4c66daaadd885c7dcd7700764102208e713c7609 (diff) |
spi-generic: Print an error when trying to use a non-existent bus
...because I just spent hours chasing a refactoring bug that would have
been way more obvious with a little more error transparency in here.
Signed-off-by: Julius Werner <jwerner@chromium.org>
Change-Id: I3354ff0370ae79f05e5c37d292ac16d446898606
Reviewed-on: https://review.coreboot.org/c/coreboot/+/57573
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Furquan Shaikh <furquan@google.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/drivers/spi/spi-generic.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/drivers/spi/spi-generic.c b/src/drivers/spi/spi-generic.c index 597a22dfea..116daf9088 100644 --- a/src/drivers/spi/spi-generic.c +++ b/src/drivers/spi/spi-generic.c @@ -123,8 +123,10 @@ int spi_setup_slave(unsigned int bus, unsigned int cs, struct spi_slave *slave) } } - if (slave->ctrlr == NULL) + if (slave->ctrlr == NULL) { + printk(BIOS_ERR, "Can't find SPI bus %u\n", bus); return -1; + } slave->bus = bus; slave->cs = cs; |