[PATCH v3 03/10] spi: dw: Use generic function to read reg address
Sean Anderson
seanga2 at gmail.com
Mon Sep 14 17:34:56 CEST 2020
Using an fdt-specific function causes problems when compiled with a live
tree.
Signed-off-by: Sean Anderson <seanga2 at gmail.com>
Tested-by Eugeniy Paltsev <Eugeniy.Paltsev at synopsys.com>
---
This patch was previously part of
https://patchwork.ozlabs.org/project/uboot/list/?series=161576
(no changes since v1)
drivers/spi/designware_spi.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/spi/designware_spi.c b/drivers/spi/designware_spi.c
index ce4b6c4dc2..a25f846f9a 100644
--- a/drivers/spi/designware_spi.c
+++ b/drivers/spi/designware_spi.c
@@ -156,6 +156,8 @@ static int dw_spi_ofdata_to_platdata(struct udevice *bus)
struct dw_spi_platdata *plat = bus->platdata;
plat->regs = dev_read_addr_ptr(bus);
+ if (!plat->regs)
+ return -EINVAL;
/* Use 500KHz as a suitable default */
plat->frequency = dev_read_u32_default(bus, "spi-max-frequency",
--
2.28.0
More information about the U-Boot
mailing list