usb: sisusb: let files build only when needed
authorJiri Slaby <jslaby@suse.cz>
Tue, 22 Jan 2019 15:12:01 +0000 (16:12 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 25 Jan 2019 09:02:49 +0000 (10:02 +0100)
After the previous patch we see, that whole files are ifdeffed depending
on CONFIG options. So do not build the files at all if the CONFIG is not
enabled. (I.e. move the check from .c to Makefile.)

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/misc/sisusbvga/Makefile
drivers/usb/misc/sisusbvga/sisusb_con.c
drivers/usb/misc/sisusbvga/sisusb_init.c

index 6ed3a638261a95e78b7ef7bbe68283ac7c521bfe..6551bce68ac5de6690bec848386d9e5bf5688596 100644 (file)
@@ -5,4 +5,5 @@
 
 obj-$(CONFIG_USB_SISUSBVGA) += sisusbvga.o
 
-sisusbvga-y := sisusb.o sisusb_init.o sisusb_con.o
+sisusbvga-y := sisusb.o
+sisusbvga-$(CONFIG_USB_SISUSBVGA_CON) += sisusb_con.o sisusb_init.o
index 10c15723a7c53c426c0ad9c52e7a6cd4d57c5d14..8e6d1b02e7c202b6d2cf51b6db6bb950b431f1c0 100644 (file)
@@ -70,8 +70,6 @@
 #include "sisusb.h"
 #include "sisusb_init.h"
 
-#ifdef CONFIG_USB_SISUSBVGA_CON
-
 #define sisusbcon_writew(val, addr)    (*(addr) = (val))
 #define sisusbcon_readw(addr)          (*(addr))
 #define sisusbcon_memmovew(d, s, c)    memmove(d, s, c)
@@ -1534,8 +1532,3 @@ void __init sisusb_init_concode(void)
        for (i = 0; i < MAX_NR_CONSOLES; i++)
                mysisusbs[i] = NULL;
 }
-
-#endif /* INCL_CON */
-
-
-
index 0f7170f5b53f0f06a2a9844be119352e5e241fe3..66f6ab5acd974a26c75fba75ef08bc17dc300b3c 100644 (file)
@@ -44,9 +44,6 @@
 #include <linux/spinlock.h>
 
 #include "sisusb.h"
-
-#ifdef CONFIG_USB_SISUSBVGA_CON
-
 #include "sisusb_init.h"
 
 /*********************************************/
@@ -955,5 +952,3 @@ int SiSUSBSetVESAMode(struct SiS_Private *SiS_Pr, unsigned short VModeNo)
 
        return SiSUSBSetMode(SiS_Pr, ModeNo);
 }
-
-#endif /* CONFIG_USB_SISUSBVGA_CON */