stdio: Add force parameter to stdio_deregister

In some cases we really want to move forward with a deregister, add a force
parameter to allow this, and replace the dev with a nulldev in this case.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
This commit is contained in:
Hans de Goede
2014-09-20 16:54:37 +02:00
committed by Marek Vasut
parent 3f78a28037
commit 32d019265d
4 changed files with 14 additions and 7 deletions

View File

@@ -198,7 +198,7 @@ static int serial_pre_remove(struct udevice *dev)
#ifdef CONFIG_SYS_STDIO_DEREGISTER
struct serial_dev_priv *upriv = dev->uclass_priv;
if (stdio_deregister_dev(upriv->sdev))
if (stdio_deregister_dev(upriv->sdev), 0)
return -EPERM;
#endif