Skip to content

Commit

Permalink
staging: comedi: Makefile: conditionally compile multi-file core module
Browse files Browse the repository at this point in the history
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 <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
H Hartley Sweeten authored and Greg Kroah-Hartman committed Jan 7, 2013
1 parent 5eaf711 commit fd958f7
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 15 deletions.
15 changes: 6 additions & 9 deletions drivers/staging/comedi/Makefile
Original file line number Diff line number Diff line change
@@ -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/
4 changes: 0 additions & 4 deletions drivers/staging/comedi/comedi_compat32.c
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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 */
2 changes: 0 additions & 2 deletions drivers/staging/comedi/proc.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
#include <linux/proc_fs.h>
#include <linux/string.h>

#ifdef CONFIG_PROC_FS
static int comedi_read(char *buf, char **start, off_t offset, int len,
int *eof, void *data)
{
Expand Down Expand Up @@ -92,4 +91,3 @@ void comedi_proc_cleanup(void)
{
remove_proc_entry("comedi", NULL);
}
#endif

0 comments on commit fd958f7

Please sign in to comment.