summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJulius Werner <jwerner@chromium.org>2021-09-10 19:08:48 -0700
committerFelix Held <felix-coreboot@felixheld.de>2021-09-13 13:49:00 +0000
commitc1b98a43ae3493f3c91e432dfa49207a3b6a4ac4 (patch)
treee7bd6117597c5a0be6de80b6047a58f33bd8dfe8 /src
parent4c66daaadd885c7dcd7700764102208e713c7609 (diff)
downloadcoreboot-c1b98a43ae3493f3c91e432dfa49207a3b6a4ac4.tar.gz
coreboot-c1b98a43ae3493f3c91e432dfa49207a3b6a4ac4.tar.bz2
coreboot-c1b98a43ae3493f3c91e432dfa49207a3b6a4ac4.zip
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.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/drivers/spi/spi-generic.c b/src/drivers/spi/spi-generic.c
index 597a22dfea69..116daf9088fa 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;