From: Sean Anderson Date: Fri, 16 Oct 2020 22:57:46 +0000 (-0400) Subject: spi: dw: Use generic function to read reg address X-Git-Url: http://git.dujemihanovic.xyz/login.html?a=commitdiff_plain;h=c785f43ffdf402ecd109bbce972c25e32bc4c85b;p=u-boot.git spi: dw: Use generic function to read reg address Using an fdt-specific function causes problems when compiled with a live tree. Signed-off-by: Sean Anderson Tested-by Eugeniy Paltsev Reviewed-by: Jagan Teki --- diff --git a/drivers/spi/designware_spi.c b/drivers/spi/designware_spi.c index 32de33f695..e8ba80ef41 100644 --- a/drivers/spi/designware_spi.c +++ b/drivers/spi/designware_spi.c @@ -160,6 +160,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",