summaryrefslogtreecommitdiff
path: root/drivers/serial
diff options
context:
space:
mode:
authorJohan Jonker <[email protected]>2023-03-13 01:32:04 +0100
committerKever Yang <[email protected]>2023-05-06 17:28:18 +0800
commita12a73b66476c48dfe5afd2c3711153d09feda6c (patch)
tree3a73c36e66587675ac707d82a8852653d4eaec65 /drivers/serial
parente5822ecba2d73e64ca55c26fc4762d9e80b1f1b5 (diff)
drivers: use dev_read_addr_ptr when cast to pointer
The fdt_addr_t and phys_addr_t size have been decoupled. A 32bit CPU can expect 64-bit data from the device tree parser, so use dev_read_addr_ptr instead of the dev_read_addr function in the various files in the drivers directory that cast to a pointer. As we are there also streamline the error response to -EINVAL on return. Signed-off-by: Johan Jonker <[email protected]> Reviewed-by: Simon Glass <[email protected]>
Diffstat (limited to 'drivers/serial')
-rw-r--r--drivers/serial/serial_zynq.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/serial/serial_zynq.c b/drivers/serial/serial_zynq.c
index 9bb9b7d3b8d..1847d1f6ecd 100644
--- a/drivers/serial/serial_zynq.c
+++ b/drivers/serial/serial_zynq.c
@@ -259,9 +259,9 @@ static int zynq_serial_of_to_plat(struct udevice *dev)
{
struct zynq_uart_plat *plat = dev_get_plat(dev);
- plat->regs = (struct uart_zynq *)dev_read_addr(dev);
- if (IS_ERR(plat->regs))
- return PTR_ERR(plat->regs);
+ plat->regs = dev_read_addr_ptr(dev);
+ if (!plat->regs)
+ return -EINVAL;
return 0;
}