dm: spi: Add logging of some return values
When SPI flash operations fail it is helpful to be able to see the error
codes and where they are generated. Add logging to capture this
information for read operations.
Signed-off-by: Simon Glass <sjg@chromium.org>
diff --git a/drivers/spi/spi-uclass.c b/drivers/spi/spi-uclass.c
index c517d06..b84255b 100644
--- a/drivers/spi/spi-uclass.c
+++ b/drivers/spi/spi-uclass.c
@@ -63,11 +63,11 @@
int ret = spi_set_speed_mode(bus, speed, slave->mode);
if (ret)
- return ret;
+ return log_ret(ret);
slave->speed = speed;
}
- return ops->claim_bus ? ops->claim_bus(dev) : 0;
+ return log_ret(ops->claim_bus ? ops->claim_bus(dev) : 0);
}
void dm_spi_release_bus(struct udevice *dev)
@@ -92,7 +92,7 @@
int spi_claim_bus(struct spi_slave *slave)
{
- return dm_spi_claim_bus(slave->dev);
+ return log_ret(dm_spi_claim_bus(slave->dev));
}
void spi_release_bus(struct spi_slave *slave)