diff mbox

[U-Boot,28/28] Convert CONFIG_SYS_STDIO_DEREGISTER to Kconfig

Message ID 1474324392-26596-29-git-send-email-sjg@chromium.org
State Changes Requested
Delegated to: Tom Rini
Headers show

Commit Message

Simon Glass Sept. 19, 2016, 10:33 p.m. UTC
This converts the following to Kconfig:
   CONFIG_SYS_STDIO_DEREGISTER

This option should never be enabled in SPL, so use
CONFIG_IS_ENABLED(SYS_STDIO_DEREGISTER) when checking the option.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

 arch/arm/mach-tegra/Kconfig         | 3 +++
 arch/x86/Kconfig                    | 3 +++
 board/sunxi/Kconfig                 | 3 +++
 common/Kconfig                      | 8 ++++++++
 common/stdio.c                      | 6 +++---
 common/usb_kbd.c                    | 2 +-
 configs/Cyrus_P5020_defconfig       | 1 +
 configs/Cyrus_P5040_defconfig       | 1 +
 configs/MIP405_defconfig            | 1 +
 configs/MPC8610HPCD_defconfig       | 1 +
 configs/MPC8641HPCN_36BIT_defconfig | 1 +
 configs/MPC8641HPCN_defconfig       | 1 +
 configs/PIP405_defconfig            | 1 +
 configs/VCMA9_defconfig             | 1 +
 configs/cm_fx6_defconfig            | 1 +
 configs/novena_defconfig            | 1 +
 configs/rpi_2_defconfig             | 1 +
 configs/rpi_3_32b_defconfig         | 1 +
 configs/rpi_3_defconfig             | 1 +
 configs/rpi_defconfig               | 1 +
 configs/sandbox_defconfig           | 1 +
 configs/sandbox_noblk_defconfig     | 1 +
 configs/sandbox_spl_defconfig       | 1 +
 configs/tbs2910_defconfig           | 1 +
 drivers/serial/serial-uclass.c      | 2 +-
 include/configs/MIP405.h            | 1 -
 include/configs/MPC8610HPCD.h       | 1 -
 include/configs/MPC8641HPCN.h       | 1 -
 include/configs/PIP405.h            | 1 -
 include/configs/VCMA9.h             | 1 -
 include/configs/cm_fx6.h            | 1 -
 include/configs/cyrus.h             | 1 -
 include/configs/gr_ep2s60.h         | 1 -
 include/configs/novena.h            | 1 -
 include/configs/rpi.h               | 1 -
 include/configs/sandbox.h           | 2 --
 include/configs/sunxi-common.h      | 1 -
 include/configs/tbs2910.h           | 1 -
 include/configs/tegra-common.h      | 4 ----
 include/configs/x86-common.h        | 2 --
 include/stdio_dev.h                 | 2 +-
 scripts/config_whitelist.txt        | 1 -
 42 files changed, 41 insertions(+), 27 deletions(-)

Comments

Tom Rini Sept. 23, 2016, 7:59 p.m. UTC | #1
On Mon, Sep 19, 2016 at 04:33:12PM -0600, Simon Glass wrote:

> This converts the following to Kconfig:
>    CONFIG_SYS_STDIO_DEREGISTER
> 
> This option should never be enabled in SPL, so use
> CONFIG_IS_ENABLED(SYS_STDIO_DEREGISTER) when checking the option.
> 
> Signed-off-by: Simon Glass <sjg@chromium.org>
[snip]
> diff --git a/arch/arm/mach-tegra/Kconfig b/arch/arm/mach-tegra/Kconfig
> index 76909ee..3800225 100644
> --- a/arch/arm/mach-tegra/Kconfig
> +++ b/arch/arm/mach-tegra/Kconfig
> @@ -12,6 +12,9 @@ config SPL_LIBGENERIC_SUPPORT
>  config SPL_SERIAL_SUPPORT
>  	default y
>  
> +config SYS_STDIO_DEREGISTER
> +	default y
> +
>  config TEGRA_IVC
>  	bool "Tegra IVC protocol"
>  	help
> diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
> index 5193ee7..b15935d 100644
> --- a/arch/x86/Kconfig
> +++ b/arch/x86/Kconfig
> @@ -34,6 +34,9 @@ config VENDOR_INTEL
>  
>  endchoice
>  
> +config SYS_STDIO_DEREGISTER
> +	default y if X86
> +
>  # board-specific options below
>  source "board/advantech/Kconfig"
>  source "board/congatec/Kconfig"
> diff --git a/board/sunxi/Kconfig b/board/sunxi/Kconfig
> index 9954f0a..23413f1 100644
> --- a/board/sunxi/Kconfig
> +++ b/board/sunxi/Kconfig
> @@ -27,6 +27,9 @@ config SPL_POWER_SUPPORT
>  config SPL_SERIAL_SUPPORT
>  	default y
>  
> +config SYS_STDIO_DEREGISTER
> +	default y
> +
>  config PRE_CONSOLE_BUFFER
>  # Note only one of these may be selected at a time! But hidden choices are
>  # not supported by Kconfig
> diff --git a/common/Kconfig b/common/Kconfig
> index 815e11d..149d002 100644
> --- a/common/Kconfig
> +++ b/common/Kconfig
> @@ -326,6 +326,14 @@ config SYS_CONSOLE_INFO_QUIET
>  	  Enable this option to supress this output. It can be obtained by
>  	  calling stdio_print_current_devices() from board code.
>  
> +config SYS_STDIO_DEREGISTER
> +	bool "Allow deregistering stdio devices"
> +	help
> +	  Generally there is no need to deregister stdio devices since they
> +	  are never deactivated. But if a stdio device is used which can be
> +	  removed (for example a USB keyboard) then this option can be
> +	  enabled to ensure this is handled correctly.
> +

Maybe this needs to be default y if we have USB_KBD and a few other
things?  This isn't as bad as some of the others, so if we need to come
back later on this, that's OK I suppose..  Thanks!
diff mbox

Patch

diff --git a/arch/arm/mach-tegra/Kconfig b/arch/arm/mach-tegra/Kconfig
index 76909ee..3800225 100644
--- a/arch/arm/mach-tegra/Kconfig
+++ b/arch/arm/mach-tegra/Kconfig
@@ -12,6 +12,9 @@  config SPL_LIBGENERIC_SUPPORT
 config SPL_SERIAL_SUPPORT
 	default y
 
+config SYS_STDIO_DEREGISTER
+	default y
+
 config TEGRA_IVC
 	bool "Tegra IVC protocol"
 	help
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 5193ee7..b15935d 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -34,6 +34,9 @@  config VENDOR_INTEL
 
 endchoice
 
+config SYS_STDIO_DEREGISTER
+	default y if X86
+
 # board-specific options below
 source "board/advantech/Kconfig"
 source "board/congatec/Kconfig"
diff --git a/board/sunxi/Kconfig b/board/sunxi/Kconfig
index 9954f0a..23413f1 100644
--- a/board/sunxi/Kconfig
+++ b/board/sunxi/Kconfig
@@ -27,6 +27,9 @@  config SPL_POWER_SUPPORT
 config SPL_SERIAL_SUPPORT
 	default y
 
+config SYS_STDIO_DEREGISTER
+	default y
+
 config PRE_CONSOLE_BUFFER
 # Note only one of these may be selected at a time! But hidden choices are
 # not supported by Kconfig
diff --git a/common/Kconfig b/common/Kconfig
index 815e11d..149d002 100644
--- a/common/Kconfig
+++ b/common/Kconfig
@@ -326,6 +326,14 @@  config SYS_CONSOLE_INFO_QUIET
 	  Enable this option to supress this output. It can be obtained by
 	  calling stdio_print_current_devices() from board code.
 
+config SYS_STDIO_DEREGISTER
+	bool "Allow deregistering stdio devices"
+	help
+	  Generally there is no need to deregister stdio devices since they
+	  are never deactivated. But if a stdio device is used which can be
+	  removed (for example a USB keyboard) then this option can be
+	  enabled to ensure this is handled correctly.
+
 endmenu
 
 config SYS_NO_FLASH
diff --git a/common/stdio.c b/common/stdio.c
index f99cfe7..c849a9a 100644
--- a/common/stdio.c
+++ b/common/stdio.c
@@ -37,7 +37,7 @@  char *stdio_names[MAX_FILES] = { "stdin", "stdout", "stderr" };
 #define	CONFIG_SYS_DEVICE_NULLDEV	1
 #endif
 
-#ifdef	CONFIG_SYS_STDIO_DEREGISTER
+#if CONFIG_IS_ENABLED(SYS_STDIO_DEREGISTER)
 #define	CONFIG_SYS_DEVICE_NULLDEV	1
 #endif
 
@@ -177,7 +177,7 @@  int stdio_register(struct stdio_dev *dev)
 /* deregister the device "devname".
  * returns 0 if success, -1 if device is assigned and 1 if devname not found
  */
-#ifdef	CONFIG_SYS_STDIO_DEREGISTER
+#if CONFIG_IS_ENABLED(SYS_STDIO_DEREGISTER)
 int stdio_deregister_dev(struct stdio_dev *dev, int force)
 {
 	int l;
@@ -224,7 +224,7 @@  int stdio_deregister(const char *devname, int force)
 
 	return stdio_deregister_dev(dev, force);
 }
-#endif	/* CONFIG_SYS_STDIO_DEREGISTER */
+#endif /* CONFIG_IS_ENABLED(SYS_STDIO_DEREGISTER) */
 
 int stdio_init_tables(void)
 {
diff --git a/common/usb_kbd.c b/common/usb_kbd.c
index 97f79f8..d8812dd 100644
--- a/common/usb_kbd.c
+++ b/common/usb_kbd.c
@@ -570,7 +570,7 @@  int drv_usb_kbd_init(void)
 /* Deregister the keyboard. */
 int usb_kbd_deregister(int force)
 {
-#ifdef CONFIG_SYS_STDIO_DEREGISTER
+#if CONFIG_IS_ENABLED(SYS_STDIO_DEREGISTER)
 	struct stdio_dev *dev;
 	struct usb_device *usb_kbd_dev;
 	struct usb_kbd_pdata *data;
diff --git a/configs/Cyrus_P5020_defconfig b/configs/Cyrus_P5020_defconfig
index 9dd8742..560d175 100644
--- a/configs/Cyrus_P5020_defconfig
+++ b/configs/Cyrus_P5020_defconfig
@@ -1,4 +1,5 @@ 
 CONFIG_PPC=y
+CONFIG_SYS_STDIO_DEREGISTER=y
 CONFIG_MPC85xx=y
 CONFIG_TARGET_CYRUS=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
diff --git a/configs/Cyrus_P5040_defconfig b/configs/Cyrus_P5040_defconfig
index ff36be4..944c756 100644
--- a/configs/Cyrus_P5040_defconfig
+++ b/configs/Cyrus_P5040_defconfig
@@ -1,4 +1,5 @@ 
 CONFIG_PPC=y
+CONFIG_SYS_STDIO_DEREGISTER=y
 CONFIG_MPC85xx=y
 CONFIG_TARGET_CYRUS=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
diff --git a/configs/MIP405_defconfig b/configs/MIP405_defconfig
index ab36a65..18a04c7 100644
--- a/configs/MIP405_defconfig
+++ b/configs/MIP405_defconfig
@@ -1,4 +1,5 @@ 
 CONFIG_PPC=y
+CONFIG_SYS_STDIO_DEREGISTER=y
 CONFIG_VIDEO=y
 CONFIG_4xx=y
 CONFIG_TARGET_MIP405=y
diff --git a/configs/MPC8610HPCD_defconfig b/configs/MPC8610HPCD_defconfig
index f79cc04..ca3cc54 100644
--- a/configs/MPC8610HPCD_defconfig
+++ b/configs/MPC8610HPCD_defconfig
@@ -1,4 +1,5 @@ 
 CONFIG_PPC=y
+CONFIG_SYS_STDIO_DEREGISTER=y
 CONFIG_VIDEO=y
 CONFIG_MPC86xx=y
 CONFIG_TARGET_MPC8610HPCD=y
diff --git a/configs/MPC8641HPCN_36BIT_defconfig b/configs/MPC8641HPCN_36BIT_defconfig
index 09c41e7..2423eb8 100644
--- a/configs/MPC8641HPCN_36BIT_defconfig
+++ b/configs/MPC8641HPCN_36BIT_defconfig
@@ -1,4 +1,5 @@ 
 CONFIG_PPC=y
+CONFIG_SYS_STDIO_DEREGISTER=y
 CONFIG_VIDEO=y
 CONFIG_MPC86xx=y
 CONFIG_TARGET_MPC8641HPCN=y
diff --git a/configs/MPC8641HPCN_defconfig b/configs/MPC8641HPCN_defconfig
index 61a6ae8..7ce078d 100644
--- a/configs/MPC8641HPCN_defconfig
+++ b/configs/MPC8641HPCN_defconfig
@@ -1,4 +1,5 @@ 
 CONFIG_PPC=y
+CONFIG_SYS_STDIO_DEREGISTER=y
 CONFIG_VIDEO=y
 CONFIG_MPC86xx=y
 CONFIG_TARGET_MPC8641HPCN=y
diff --git a/configs/PIP405_defconfig b/configs/PIP405_defconfig
index dbd5e5d..2f24451 100644
--- a/configs/PIP405_defconfig
+++ b/configs/PIP405_defconfig
@@ -1,4 +1,5 @@ 
 CONFIG_PPC=y
+CONFIG_SYS_STDIO_DEREGISTER=y
 CONFIG_VIDEO=y
 CONFIG_4xx=y
 CONFIG_TARGET_PIP405=y
diff --git a/configs/VCMA9_defconfig b/configs/VCMA9_defconfig
index 123562c..7a8286e 100644
--- a/configs/VCMA9_defconfig
+++ b/configs/VCMA9_defconfig
@@ -1,5 +1,6 @@ 
 CONFIG_ARM=y
 CONFIG_TARGET_VCMA9=y
+CONFIG_SYS_STDIO_DEREGISTER=y
 CONFIG_BOOTDELAY=5
 CONFIG_HUSH_PARSER=y
 CONFIG_SYS_PROMPT="VCMA9 # "
diff --git a/configs/cm_fx6_defconfig b/configs/cm_fx6_defconfig
index c3754b2..0d28ced 100644
--- a/configs/cm_fx6_defconfig
+++ b/configs/cm_fx6_defconfig
@@ -10,6 +10,7 @@  CONFIG_SPL_SERIAL_SUPPORT=y
 CONFIG_SPL_SPI_FLASH_SUPPORT=y
 CONFIG_SPL_SPI_SUPPORT=y
 CONFIG_SPL_WATCHDOG_SUPPORT=y
+CONFIG_SYS_STDIO_DEREGISTER=y
 CONFIG_VIDEO=y
 CONFIG_OF_BOARD_SETUP=y
 CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=arch/arm/imx-common/spl_sd.cfg,MX6QDL,SPL"
diff --git a/configs/novena_defconfig b/configs/novena_defconfig
index 1d7226f..d9376fd 100644
--- a/configs/novena_defconfig
+++ b/configs/novena_defconfig
@@ -11,6 +11,7 @@  CONFIG_SPL_LIBDISK_SUPPORT=y
 CONFIG_SPL_MMC_SUPPORT=y
 CONFIG_SPL_SERIAL_SUPPORT=y
 CONFIG_SPL_WATCHDOG_SUPPORT=y
+CONFIG_SYS_STDIO_DEREGISTER=y
 CONFIG_VIDEO=y
 CONFIG_FIT=y
 CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=arch/arm/imx-common/spl_sd.cfg,MX6Q"
diff --git a/configs/rpi_2_defconfig b/configs/rpi_2_defconfig
index a97c910..cc9c5f7 100644
--- a/configs/rpi_2_defconfig
+++ b/configs/rpi_2_defconfig
@@ -1,6 +1,7 @@ 
 CONFIG_ARM=y
 CONFIG_ARCH_BCM283X=y
 CONFIG_TARGET_RPI_2=y
+CONFIG_SYS_STDIO_DEREGISTER=y
 CONFIG_OF_BOARD_SETUP=y
 CONFIG_CONSOLE_MUX=y
 CONFIG_SYS_CONSOLE_IS_IN_ENV=y
diff --git a/configs/rpi_3_32b_defconfig b/configs/rpi_3_32b_defconfig
index bbb1487..2b0014c 100644
--- a/configs/rpi_3_32b_defconfig
+++ b/configs/rpi_3_32b_defconfig
@@ -2,6 +2,7 @@  CONFIG_ARM=y
 CONFIG_ARCH_BCM283X=y
 CONFIG_TARGET_RPI_3_32B=y
 CONFIG_SYS_MALLOC_F_LEN=0x2000
+CONFIG_SYS_STDIO_DEREGISTER=y
 CONFIG_OF_BOARD_SETUP=y
 CONFIG_CONSOLE_MUX=y
 CONFIG_SYS_CONSOLE_IS_IN_ENV=y
diff --git a/configs/rpi_3_defconfig b/configs/rpi_3_defconfig
index bdb37e0..f6d18e4 100644
--- a/configs/rpi_3_defconfig
+++ b/configs/rpi_3_defconfig
@@ -2,6 +2,7 @@  CONFIG_ARM=y
 CONFIG_ARCH_BCM283X=y
 CONFIG_TARGET_RPI_3=y
 CONFIG_SYS_MALLOC_F_LEN=0x2000
+CONFIG_SYS_STDIO_DEREGISTER=y
 CONFIG_OF_BOARD_SETUP=y
 CONFIG_CONSOLE_MUX=y
 CONFIG_SYS_CONSOLE_IS_IN_ENV=y
diff --git a/configs/rpi_defconfig b/configs/rpi_defconfig
index 5510833..100c5b8 100644
--- a/configs/rpi_defconfig
+++ b/configs/rpi_defconfig
@@ -1,6 +1,7 @@ 
 CONFIG_ARM=y
 CONFIG_ARCH_BCM283X=y
 CONFIG_TARGET_RPI=y
+CONFIG_SYS_STDIO_DEREGISTER=y
 CONFIG_OF_BOARD_SETUP=y
 CONFIG_CONSOLE_MUX=y
 CONFIG_SYS_CONSOLE_IS_IN_ENV=y
diff --git a/configs/sandbox_defconfig b/configs/sandbox_defconfig
index 082db0a..c95c016 100644
--- a/configs/sandbox_defconfig
+++ b/configs/sandbox_defconfig
@@ -1,4 +1,5 @@ 
 CONFIG_SYS_MALLOC_F_LEN=0x2000
+CONFIG_SYS_STDIO_DEREGISTER=y
 CONFIG_MMC=y
 CONFIG_PCI=y
 CONFIG_DEFAULT_DEVICE_TREE="sandbox"
diff --git a/configs/sandbox_noblk_defconfig b/configs/sandbox_noblk_defconfig
index e659011..69697a9 100644
--- a/configs/sandbox_noblk_defconfig
+++ b/configs/sandbox_noblk_defconfig
@@ -1,4 +1,5 @@ 
 CONFIG_SYS_MALLOC_F_LEN=0x2000
+CONFIG_SYS_STDIO_DEREGISTER=y
 CONFIG_PCI=y
 CONFIG_DEFAULT_DEVICE_TREE="sandbox"
 CONFIG_I8042_KEYB=y
diff --git a/configs/sandbox_spl_defconfig b/configs/sandbox_spl_defconfig
index 6444d42..52b68f9 100644
--- a/configs/sandbox_spl_defconfig
+++ b/configs/sandbox_spl_defconfig
@@ -3,6 +3,7 @@  CONFIG_SPL_LIBGENERIC_SUPPORT=y
 CONFIG_SPL_SERIAL_SUPPORT=y
 CONFIG_SPL_ENV_SUPPORT=y
 CONFIG_SPL_DRIVERS_MISC_SUPPORT=y
+CONFIG_SYS_STDIO_DEREGISTER=y
 CONFIG_MMC=y
 CONFIG_SANDBOX_SPL=y
 CONFIG_PCI=y
diff --git a/configs/tbs2910_defconfig b/configs/tbs2910_defconfig
index a5af151..ec4fbf6 100644
--- a/configs/tbs2910_defconfig
+++ b/configs/tbs2910_defconfig
@@ -1,6 +1,7 @@ 
 CONFIG_ARM=y
 CONFIG_ARCH_MX6=y
 CONFIG_TARGET_TBS2910=y
+CONFIG_SYS_STDIO_DEREGISTER=y
 CONFIG_PRE_CONSOLE_BUFFER=y
 CONFIG_PRE_CON_BUF_SZ=4096
 CONFIG_PRE_CON_BUF_ADDR=0x7c000000
diff --git a/drivers/serial/serial-uclass.c b/drivers/serial/serial-uclass.c
index 19f38e1..43c028e 100644
--- a/drivers/serial/serial-uclass.c
+++ b/drivers/serial/serial-uclass.c
@@ -346,7 +346,7 @@  static int serial_post_probe(struct udevice *dev)
 
 static int serial_pre_remove(struct udevice *dev)
 {
-#ifdef CONFIG_SYS_STDIO_DEREGISTER
+#if CONFIG_IS_ENABLED(SYS_STDIO_DEREGISTER)
 	struct serial_dev_priv *upriv = dev_get_uclass_priv(dev);
 
 	if (stdio_deregister_dev(upriv->sdev, 0))
diff --git a/include/configs/MIP405.h b/include/configs/MIP405.h
index 2dd8ba9..d54c8f8 100644
--- a/include/configs/MIP405.h
+++ b/include/configs/MIP405.h
@@ -353,7 +353,6 @@ 
 #define CONFIG_USB_KEYBOARD
 
 /* Enable needed helper functions */
-#define CONFIG_SYS_STDIO_DEREGISTER		/* needs stdio_deregister */
 #endif
 /************************************************************
  * Debug support
diff --git a/include/configs/MPC8610HPCD.h b/include/configs/MPC8610HPCD.h
index 7882b35..ec15587 100644
--- a/include/configs/MPC8610HPCD.h
+++ b/include/configs/MPC8610HPCD.h
@@ -286,7 +286,6 @@ 
 #define CONFIG_PCI_OHCI		1
 #define CONFIG_USB_OHCI_NEW		1
 #define CONFIG_USB_KEYBOARD	1
-#define CONFIG_SYS_STDIO_DEREGISTER
 #define CONFIG_SYS_USB_EVENT_POLL	1
 #define CONFIG_SYS_USB_OHCI_SLOT_NAME	"ohci_pci"
 #define CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS 15
diff --git a/include/configs/MPC8641HPCN.h b/include/configs/MPC8641HPCN.h
index 2c15f3d..35d9f8d 100644
--- a/include/configs/MPC8641HPCN.h
+++ b/include/configs/MPC8641HPCN.h
@@ -364,7 +364,6 @@  extern unsigned long get_board_sys_clk(unsigned long dummy);
 #define CONFIG_PCI_OHCI			1
 #define CONFIG_USB_OHCI_NEW		1
 #define CONFIG_USB_KEYBOARD		1
-#define CONFIG_SYS_STDIO_DEREGISTER
 #define CONFIG_SYS_USB_EVENT_POLL		1
 #define CONFIG_SYS_USB_OHCI_SLOT_NAME		"ohci_pci"
 #define CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS	15
diff --git a/include/configs/PIP405.h b/include/configs/PIP405.h
index ee8a85e..ffea459 100644
--- a/include/configs/PIP405.h
+++ b/include/configs/PIP405.h
@@ -309,7 +309,6 @@ 
 #define CONFIG_USB_KEYBOARD
 
 /* Enable needed helper functions */
-#define CONFIG_SYS_STDIO_DEREGISTER		/* needs stdio_deregister */
 
 /************************************************************
  * Debug support
diff --git a/include/configs/VCMA9.h b/include/configs/VCMA9.h
index c5a7d68..54c93b0 100644
--- a/include/configs/VCMA9.h
+++ b/include/configs/VCMA9.h
@@ -104,7 +104,6 @@ 
 #define CONFIG_DOS_PARTITION
 
 /* Enable needed helper functions */
-#define CONFIG_SYS_STDIO_DEREGISTER	/* needs stdio_deregister */
 
 /* RTC */
 #define CONFIG_RTC_S3C24X0
diff --git a/include/configs/cm_fx6.h b/include/configs/cm_fx6.h
index 325c019..8b1e30d 100644
--- a/include/configs/cm_fx6.h
+++ b/include/configs/cm_fx6.h
@@ -211,7 +211,6 @@ 
 #define CONFIG_MXC_USB_FLAGS		0
 #define CONFIG_USB_MAX_CONTROLLER_COUNT	2
 #define CONFIG_EHCI_HCD_INIT_AFTER_RESET	/* For OTG port */
-#define CONFIG_SYS_STDIO_DEREGISTER
 
 /* I2C */
 #define CONFIG_SYS_I2C
diff --git a/include/configs/cyrus.h b/include/configs/cyrus.h
index 78eb567..75cef04 100644
--- a/include/configs/cyrus.h
+++ b/include/configs/cyrus.h
@@ -449,7 +449,6 @@ 
 #define CONFIG_EHCI_HCD_INIT_AFTER_RESET
 #define CONFIG_EHCI_IS_TDI
 #define CONFIG_USB_KEYBOARD
-#define CONFIG_SYS_STDIO_DEREGISTER
 #define CONFIG_SYS_USB_EVENT_POLL
  /* _VIA_CONTROL_EP  */
 #endif
diff --git a/include/configs/gr_ep2s60.h b/include/configs/gr_ep2s60.h
index 265f03c..9e2fd40 100644
--- a/include/configs/gr_ep2s60.h
+++ b/include/configs/gr_ep2s60.h
@@ -60,7 +60,6 @@ 
 #if USE_GRUSB
 #define CONFIG_USB_UHCI
 /* Enable needed helper functions */
-#define CONFIG_SYS_STDIO_DEREGISTER	/* needs stdio_deregister */
 #endif
 
 /*
diff --git a/include/configs/novena.h b/include/configs/novena.h
index 0983b96..5684809 100644
--- a/include/configs/novena.h
+++ b/include/configs/novena.h
@@ -143,7 +143,6 @@ 
 #define CONFIG_USB_EHCI
 #define CONFIG_USB_EHCI_MX6
 #define CONFIG_USB_KEYBOARD
-#define CONFIG_SYS_STDIO_DEREGISTER
 #define CONFIG_SYS_USB_EVENT_POLL_VIA_CONTROL_EP
 #define CONFIG_USB_HOST_ETHER
 #define CONFIG_USB_ETHER_ASIX
diff --git a/include/configs/rpi.h b/include/configs/rpi.h
index 7fe469c..09cfc8a 100644
--- a/include/configs/rpi.h
+++ b/include/configs/rpi.h
@@ -102,7 +102,6 @@ 
 #define CONFIG_MISC_INIT_R
 #define CONFIG_USB_KEYBOARD
 #define CONFIG_SYS_USB_EVENT_POLL
-#define CONFIG_SYS_STDIO_DEREGISTER
 #endif
 
 /* Console UART */
diff --git a/include/configs/sandbox.h b/include/configs/sandbox.h
index b6533c3..31ab765 100644
--- a/include/configs/sandbox.h
+++ b/include/configs/sandbox.h
@@ -25,8 +25,6 @@ 
 #define CONFIG_SYS_TIMER_RATE		1000000
 #endif
 
-#define CONFIG_SYS_STDIO_DEREGISTER
-
 /*
  * Number of bits in a C 'long' on this architecture. Set this to 32 when
  * building on a 32-bit machine.
diff --git a/include/configs/sunxi-common.h b/include/configs/sunxi-common.h
index 588d7f3..dad8548 100644
--- a/include/configs/sunxi-common.h
+++ b/include/configs/sunxi-common.h
@@ -355,7 +355,6 @@  extern int soft_i2c_gpio_scl;
 
 #ifdef CONFIG_USB_KEYBOARD
 #define CONFIG_PREBOOT
-#define CONFIG_SYS_STDIO_DEREGISTER
 #define CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE
 #endif
 
diff --git a/include/configs/tbs2910.h b/include/configs/tbs2910.h
index 8fdeaa1..fa1364d 100644
--- a/include/configs/tbs2910.h
+++ b/include/configs/tbs2910.h
@@ -115,7 +115,6 @@ 
 #define CONFIG_USB_KEYBOARD
 #ifdef CONFIG_USB_KEYBOARD
 #define CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE
-#define CONFIG_SYS_STDIO_DEREGISTER
 #define CONFIG_PREBOOT \
 	"usb start; " \
 	"if hdmidet; then " \
diff --git a/include/configs/tegra-common.h b/include/configs/tegra-common.h
index 6a344a4..759a4c0 100644
--- a/include/configs/tegra-common.h
+++ b/include/configs/tegra-common.h
@@ -66,10 +66,6 @@ 
 
 #define CONFIG_SYS_NO_FLASH
 
-#ifndef CONFIG_SPL_BUILD
-#define CONFIG_SYS_STDIO_DEREGISTER
-#endif
-
 /*
  * Increasing the size of the IO buffer as default nfsargs size is more
  *  than 256 and so it is not possible to edit it
diff --git a/include/configs/x86-common.h b/include/configs/x86-common.h
index 7742020..8b18e61 100644
--- a/include/configs/x86-common.h
+++ b/include/configs/x86-common.h
@@ -62,8 +62,6 @@ 
 					 9600, 19200, 38400, 115200}
 #define CONFIG_SYS_NS16550_PORT_MAPPED
 
-#define CONFIG_SYS_STDIO_DEREGISTER
-
 #define CONFIG_CMDLINE_EDITING
 #define CONFIG_COMMAND_HISTORY
 #define CONFIG_AUTO_COMPLETE
diff --git a/include/stdio_dev.h b/include/stdio_dev.h
index 13f76be..e4fc8b1 100644
--- a/include/stdio_dev.h
+++ b/include/stdio_dev.h
@@ -100,7 +100,7 @@  int stdio_add_devices(void);
 int stdio_init(void);
 
 void	stdio_print_current_devices(void);
-#ifdef CONFIG_SYS_STDIO_DEREGISTER
+#if CONFIG_IS_ENABLED(SYS_STDIO_DEREGISTER)
 int stdio_deregister(const char *devname, int force);
 int stdio_deregister_dev(struct stdio_dev *dev, int force);
 #endif
diff --git a/scripts/config_whitelist.txt b/scripts/config_whitelist.txt
index 9f85e15..0b2ac89 100644
--- a/scripts/config_whitelist.txt
+++ b/scripts/config_whitelist.txt
@@ -7703,7 +7703,6 @@  CONFIG_SYS_STACK_LENGTH
 CONFIG_SYS_STACK_SIZE
 CONFIG_SYS_STATUS_C
 CONFIG_SYS_STATUS_OK
-CONFIG_SYS_STDIO_DEREGISTER
 CONFIG_SYS_STMICRO_BOOT
 CONFIG_SYS_SUPPORT_64BIT_DATA
 CONFIG_SYS_SXCNFG_VAL