From fd958f7eb4d0959f65377aaab4a63ba33cc53f06 Mon Sep 17 00:00:00 2001 From: H Hartley Sweeten Date: Wed, 19 Dec 2012 17:49:24 -0700 Subject: [PATCH] staging: comedi: Makefile: conditionally compile multi-file core module Instead of using the #ifdef'ery in the comedi_compat32.c and proc.c files to include/exclude them from the comedi core, modify the Makefile to include those files automatically when enabled in the .config. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Signed-off-by: Greg Kroah-Hartman --- drivers/staging/comedi/Makefile | 15 ++++++--------- drivers/staging/comedi/comedi_compat32.c | 4 ---- drivers/staging/comedi/proc.c | 2 -- 3 files changed, 6 insertions(+), 15 deletions(-) diff --git a/drivers/staging/comedi/Makefile b/drivers/staging/comedi/Makefile index 8dbd306fef88..f895c0ccc3c8 100644 --- a/drivers/staging/comedi/Makefile +++ b/drivers/staging/comedi/Makefile @@ -1,11 +1,8 @@ -obj-$(CONFIG_COMEDI) += comedi.o +comedi-y := comedi_fops.o range.o drivers.o +comedi-$(CONFIG_PROC_FS) += proc.o +comedi-$(CONFIG_COMPAT) += comedi_compat32.o -obj-$(CONFIG_COMEDI) += kcomedilib/ -obj-$(CONFIG_COMEDI) += drivers/ +obj-$(CONFIG_COMEDI) += comedi.o -comedi-y := \ - comedi_fops.o \ - proc.o \ - range.o \ - drivers.o \ - comedi_compat32.o \ +obj-$(CONFIG_COMEDI) += kcomedilib/ +obj-$(CONFIG_COMEDI) += drivers/ diff --git a/drivers/staging/comedi/comedi_compat32.c b/drivers/staging/comedi/comedi_compat32.c index 4b7cbfad1d74..ad208cdd53d4 100644 --- a/drivers/staging/comedi/comedi_compat32.c +++ b/drivers/staging/comedi/comedi_compat32.c @@ -30,8 +30,6 @@ #include "comedi.h" #include "comedi_compat32.h" -#ifdef CONFIG_COMPAT - #define COMEDI32_CHANINFO _IOR(CIO, 3, struct comedi32_chaninfo_struct) #define COMEDI32_RANGEINFO _IOR(CIO, 8, struct comedi32_rangeinfo_struct) /* N.B. COMEDI32_CMD and COMEDI_CMD ought to use _IOWR, not _IOR. @@ -460,5 +458,3 @@ long comedi_compat_ioctl(struct file *file, unsigned int cmd, unsigned long arg) { return raw_ioctl(file, cmd, arg); } - -#endif /* CONFIG_COMPAT */ diff --git a/drivers/staging/comedi/proc.c b/drivers/staging/comedi/proc.c index 732134f30fe3..362c214bcc0b 100644 --- a/drivers/staging/comedi/proc.c +++ b/drivers/staging/comedi/proc.c @@ -33,7 +33,6 @@ #include #include -#ifdef CONFIG_PROC_FS static int comedi_read(char *buf, char **start, off_t offset, int len, int *eof, void *data) { @@ -92,4 +91,3 @@ void comedi_proc_cleanup(void) { remove_proc_entry("comedi", NULL); } -#endif -- 2.30.2