Message ID | 20170424074804.15143-2-sr@denx.de |
---|---|
State | Accepted |
Commit | e98856fcff5adc64689c3d5597b0a36d867eec8f |
Delegated to: | Bin Meng |
Headers | show |
On 24 April 2017 at 01:48, Stefan Roese <sr@denx.de> wrote: > 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(). This patch sets the force parameter when calling > stdio_deregister_dev() resulting in a removal of the device. > > Signed-off-by: Stefan Roese <sr@denx.de> > Cc: Simon Glass <sjg@chromium.org> > Cc: Bin Meng <bmeng.cn@gmail.com> > --- > v2: > - New patch > > drivers/serial/serial-uclass.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) Reviewed-by: Simon Glass <sjg@chromium.org>
On Sat, Apr 29, 2017 at 8:26 AM, Simon Glass <sjg@chromium.org> wrote: > On 24 April 2017 at 01:48, Stefan Roese <sr@denx.de> wrote: >> 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(). This patch sets the force parameter when calling >> stdio_deregister_dev() resulting in a removal of the device. >> >> Signed-off-by: Stefan Roese <sr@denx.de> >> Cc: Simon Glass <sjg@chromium.org> >> Cc: Bin Meng <bmeng.cn@gmail.com> >> --- >> v2: >> - New patch >> >> drivers/serial/serial-uclass.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) > > Reviewed-by: Simon Glass <sjg@chromium.org> applied to u-boot-x86, thanks!
diff --git a/drivers/serial/serial-uclass.c b/drivers/serial/serial-uclass.c index 43c028ebe6..c2b9c5f12f 100644 --- a/drivers/serial/serial-uclass.c +++ b/drivers/serial/serial-uclass.c @@ -349,7 +349,7 @@ static int serial_pre_remove(struct udevice *dev) #if CONFIG_IS_ENABLED(SYS_STDIO_DEREGISTER) struct serial_dev_priv *upriv = dev_get_uclass_priv(dev); - if (stdio_deregister_dev(upriv->sdev, 0)) + if (stdio_deregister_dev(upriv->sdev, true)) return -EPERM; #endif
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(). This patch sets the force parameter when calling stdio_deregister_dev() resulting in a removal of the device. Signed-off-by: Stefan Roese <sr@denx.de> Cc: Simon Glass <sjg@chromium.org> Cc: Bin Meng <bmeng.cn@gmail.com> --- v2: - New patch drivers/serial/serial-uclass.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)