From: Stefan Roese <sr@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 1/4] dm: device_remove: Don't return in device_chld_remove() upon error
Date: Thu, 6 Apr 2017 15:29:41 +0200 [thread overview]
Message-ID: <20170406132944.476-1-sr@denx.de> (raw)
On my x86 platform I've noticed, that calling dm_uninit() or the new
function dm_remove_devices_flags() does not remove the desired device at
all. Debugging showed, that the serial uclass returns -EPERM in
serial_pre_remove() and this leads to a complete stop of the device
removal pretty early, as the serial device is one of the first ones in
the DM. Here the dm tree output:
=> dm tree
Class Probed Name
----------------------------------------
root [ + ] root_driver
rsa_mod_exp [ ] |-- mod_exp_sw
serial [ + ] |-- serial
rtc [ ] |-- rtc
timer [ + ] |-- tsc-timer
syscon [ + ] |-- pch_pinctrl
...
In this example, device_remove(root) will stop directly after trying to
remove the "serial" device.
To solve this problem, this patch removes the return upon error check in
the device_remove() call in device_chld_remove(). This leads to
device_chld_remove() continuing with the device_remove() call to the
following child devices.
Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Simon Glass <sjg@chromium.org>
Cc: Bin Meng <bmeng.cn@gmail.com>
---
drivers/core/device-remove.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/drivers/core/device-remove.c b/drivers/core/device-remove.c
index cc0043b990..8b46f3343e 100644
--- a/drivers/core/device-remove.c
+++ b/drivers/core/device-remove.c
@@ -52,15 +52,11 @@ static int device_chld_unbind(struct udevice *dev)
static int device_chld_remove(struct udevice *dev, uint flags)
{
struct udevice *pos, *n;
- int ret;
assert(dev);
- list_for_each_entry_safe(pos, n, &dev->child_head, sibling_node) {
- ret = device_remove(pos, flags);
- if (ret)
- return ret;
- }
+ list_for_each_entry_safe(pos, n, &dev->child_head, sibling_node)
+ device_remove(pos, flags);
return 0;
}
--
2.12.2
next reply other threads:[~2017-04-06 13:29 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-04-06 13:29 Stefan Roese [this message]
2017-04-06 13:29 ` [U-Boot] [PATCH 2/4] dm: core: Add DM_FLAG_PRE_OS_FINALIZE flag Stefan Roese
2017-04-09 19:28 ` Simon Glass
2017-04-19 9:49 ` Stefan Roese
2017-04-06 13:29 ` [U-Boot] [PATCH 3/4] x86: bootm: Add dm_remove_devices_flags() call to bootm_announce_and_cleanup() Stefan Roese
2017-04-09 19:28 ` Simon Glass
2017-04-06 13:29 ` [U-Boot] [PATCH 4/4] spi: ich: Configure SPI BIOS parameters for Linux upon U-Boot exit Stefan Roese
2017-04-07 6:53 ` Jagan Teki
2017-04-09 19:28 ` Simon Glass
2017-04-09 19:28 ` [U-Boot] [PATCH 1/4] dm: device_remove: Don't return in device_chld_remove() upon error Simon Glass
2017-04-19 9:27 ` Stefan Roese
2017-04-24 3:38 ` Simon Glass
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170406132944.476-1-sr@denx.de \
--to=sr@denx.de \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox