mirror of
https://github.com/Fishwaldo/u-boot.git
synced 2025-03-21 06:31:31 +00:00
dm: core: Drop a few early returns
Two functions in this file return early for no good reason. Adjust the code to match the standard DM style of returning 0 at the end of the function on success. Oddly enough this save 12 bytes of code size on ARM. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
This commit is contained in:
parent
d3e773613b
commit
c8b31cce45
1 changed files with 10 additions and 4 deletions
|
@ -714,8 +714,11 @@ int uclass_pre_probe_device(struct udevice *dev)
|
|||
if (!dev->parent)
|
||||
return 0;
|
||||
uc_drv = dev->parent->uclass->uc_drv;
|
||||
if (uc_drv->child_pre_probe)
|
||||
return uc_drv->child_pre_probe(dev);
|
||||
if (uc_drv->child_pre_probe) {
|
||||
ret = uc_drv->child_pre_probe(dev);
|
||||
if (ret)
|
||||
return ret;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -735,8 +738,11 @@ int uclass_post_probe_device(struct udevice *dev)
|
|||
}
|
||||
|
||||
uc_drv = dev->uclass->uc_drv;
|
||||
if (uc_drv->post_probe)
|
||||
return uc_drv->post_probe(dev);
|
||||
if (uc_drv->post_probe) {
|
||||
ret = uc_drv->post_probe(dev);
|
||||
if (ret)
|
||||
return ret;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue