serial: zynq: Fix address reading from DM
Use dev_get_addr() instead of reading reg base directly in the driver. Core function is also more robust. Signed-off-by: Michal Simek <michal.simek@xilinx.com>
This commit is contained in:
parent
a2533183c0
commit
842efb3a93
@ -156,13 +156,8 @@ static int zynq_serial_pending(struct udevice *dev, bool input)
|
||||
static int zynq_serial_ofdata_to_platdata(struct udevice *dev)
|
||||
{
|
||||
struct zynq_uart_priv *priv = dev_get_priv(dev);
|
||||
fdt_addr_t addr;
|
||||
|
||||
addr = fdtdec_get_addr(gd->fdt_blob, dev->of_offset, "reg");
|
||||
if (addr == FDT_ADDR_T_NONE)
|
||||
return -EINVAL;
|
||||
|
||||
priv->regs = (struct uart_zynq *)addr;
|
||||
priv->regs = (struct uart_zynq *)dev_get_addr(dev);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user