tty_ldisc: simplify tty_ldisc_autoload initialization
authorPavel Machek <pavel@denx.de>
Tue, 24 Sep 2019 08:32:44 +0000 (10:32 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 4 Oct 2019 13:11:25 +0000 (15:11 +0200)
We have got existing macro to check for CONFIG option, use it.

Signed-off-by: Pavel Machek <pavel@denx.de>
Link: https://lore.kernel.org/r/20190924083244.GA4344@amd
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/tty_ldisc.c

index 4c49f53afa3ed3ca66c04ecd3f60a07d1dde0274..ec1f6a48121e384fc1df05008e4ae64d129845d1 100644 (file)
@@ -156,12 +156,7 @@ static void put_ldops(struct tty_ldisc_ops *ldops)
  *             takes tty_ldiscs_lock to guard against ldisc races
  */
 
-#if defined(CONFIG_LDISC_AUTOLOAD)
-       #define INITIAL_AUTOLOAD_STATE  1
-#else
-       #define INITIAL_AUTOLOAD_STATE  0
-#endif
-static int tty_ldisc_autoload = INITIAL_AUTOLOAD_STATE;
+static int tty_ldisc_autoload = IS_BUILTIN(CONFIG_LDISC_AUTOLOAD);
 
 static struct tty_ldisc *tty_ldisc_get(struct tty_struct *tty, int disc)
 {