summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNaveen Kumar Chaudhary <[email protected]>2026-06-26 09:16:46 +0530
committerTom Rini <[email protected]>2026-07-10 15:51:21 -0600
commit9df08fb181de1c02eec2d74096e14252d779a134 (patch)
tree9ff1e8350144b145af94a6a226ae35bf1dc77eee
parentdc3606a961fae711e51d0ec9e0cff7999b62ab2b (diff)
cmd: host: fix duplicate device_unbind and wrong error message in unbind
do_host_unbind()'s error handler for device_unbind() prints the misleading message "Cannot attach file" and then calls device_unbind() a second time on the same device, both of which look like copy-paste mistakes left over from neighbouring code. Remove the duplicate device_unbind() call and report the correct failure with the device name. Fixes: 952018117ab ("dm: sandbox: Switch over to using the new host uclass") Signed-off-by: Naveen Kumar Chaudhary <[email protected]>
-rw-r--r--cmd/host.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/cmd/host.c b/cmd/host.c
index e03576b4d2d..47a59f5ff20 100644
--- a/cmd/host.c
+++ b/cmd/host.c
@@ -132,10 +132,7 @@ static int do_host_unbind(struct cmd_tbl *cmdtp, int flag, int argc,
ret = device_unbind(dev);
if (ret) {
- printf("Cannot attach file\n");
- ret = device_unbind(dev);
- if (ret)
- printf("Cannot unbind device '%s'\n", dev->name);
+ printf("Cannot unbind device '%s'\n", dev->name);
return CMD_RET_FAILURE;
}