diff options
author | Heinrich Schuchardt <xypron.glpk@gmx.de> | 2020-02-15 21:38:48 +0100 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2020-04-16 08:07:57 -0600 |
commit | f93a07dd4f2e9096208a3230b0eca669d9760397 (patch) | |
tree | f9b8327fd9425dab868c7023e4d47c2667c7dc87 /drivers/core/device.c | |
parent | 2960107a22b32f6e17794f5e56db718ab82c896f (diff) |
dm: core: remove redundant if statement
The value of parent is not changed in the first if statement. So we can
merge the two if statements depending on parent.
Indicated by cppcheck.
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'drivers/core/device.c')
-rw-r--r-- | drivers/core/device.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/core/device.c b/drivers/core/device.c index 89ea820d48..534cfa7314 100644 --- a/drivers/core/device.c +++ b/drivers/core/device.c @@ -143,11 +143,9 @@ static int device_bind_common(struct udevice *parent, const struct driver *drv, goto fail_alloc3; } } - } - - /* put dev into parent's successor list */ - if (parent) + /* put dev into parent's successor list */ list_add_tail(&dev->sibling_node, &parent->child_head); + } ret = uclass_bind_device(dev); if (ret) |