diff options
author | Sean Anderson <seanga2@gmail.com> | 2020-10-17 01:57:46 +0300 |
---|---|---|
committer | Jagan Teki <jagan@amarulasolutions.com> | 2020-12-18 13:46:36 +0300 |
commit | c785f43ffdf402ecd109bbce972c25e32bc4c85b (patch) | |
tree | 3aa7913822d5c453b20ffa5dda3cd7afccbcb326 /drivers/spi/designware_spi.c | |
parent | 13fc44e2223b90290a2bfdfe97d3a9d37b90c7a0 (diff) | |
download | u-boot-c785f43ffdf402ecd109bbce972c25e32bc4c85b.tar.xz |
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 <seanga2@gmail.com>
Tested-by Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
Diffstat (limited to 'drivers/spi/designware_spi.c')
-rw-r--r-- | drivers/spi/designware_spi.c | 2 |
1 files changed, 2 insertions, 0 deletions
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", |