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 <naveen.osdev@gmail.com>
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;
}