serial: goldfish: return error when device address is invalid
goldfish_serial_of_to_plat() returns success even when dev_read_addr() fails to find a valid address. This leaves plat->reg unset and defers the failure to probe(). Return -EINVAL immediately when the address is FDT_ADDR_T_NONE so the failure is reported at the of_to_plat stage where it belongs. Signed-off-by: Naveen Kumar Chaudhary <naveen.osdev@gmail.com> Acked-by: Kuan-Wei Chiu <visitorckw@gmail.com>
This commit is contained in:
committed by
Tom Rini
parent
0bef438428
commit
d73aed0b05
@@ -74,8 +74,10 @@ static int goldfish_serial_of_to_plat(struct udevice *dev)
|
||||
fdt_addr_t addr;
|
||||
|
||||
addr = dev_read_addr(dev);
|
||||
if (addr != FDT_ADDR_T_NONE)
|
||||
plat->reg = addr;
|
||||
if (addr == FDT_ADDR_T_NONE)
|
||||
return -EINVAL;
|
||||
|
||||
plat->reg = addr;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user