From c6cccd7c9cc5f6993aec2b2b0ac6beed396c1176 Mon Sep 17 00:00:00 2001 From: Ian Abbott Date: Tue, 22 Aug 2006 16:26:34 +0000 Subject: [PATCH] Renamed CLASS_DEVICE_CREATE to COMEDI_CLASS_DEVICE_CREATE to avoid name clash with RTAI. --- comedi/comedi_fops.c | 3 ++- include/linux/device.h | 8 ++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/comedi/comedi_fops.c b/comedi/comedi_fops.c index 1677cbc3..07831732 100644 --- a/comedi/comedi_fops.c +++ b/comedi/comedi_fops.c @@ -1748,7 +1748,8 @@ static int __init comedi_init(void) sprintf(name, "comedi%d", i); devfs_register(NULL, name, DEVFS_FL_DEFAULT, COMEDI_MAJOR, i, 0666 | S_IFCHR, &comedi_fops, NULL); - CLASS_DEVICE_CREATE(comedi_class, 0, MKDEV(COMEDI_MAJOR, i), NULL, "comedi%i", i); + COMEDI_CLASS_DEVICE_CREATE(comedi_class, 0, + MKDEV(COMEDI_MAJOR, i), NULL, "comedi%i", i); } comedi_rt_init(); diff --git a/include/linux/device.h b/include/linux/device.h index c908b603..85a29609 100644 --- a/include/linux/device.h +++ b/include/linux/device.h @@ -27,7 +27,7 @@ static inline struct class *class_create(struct module *owner, char *name) static inline void class_destroy(struct class *cs) {}; -static inline struct class_device *CLASS_DEVICE_CREATE(struct class *cls, +static inline struct class_device *COMEDI_CLASS_DEVICE_CREATE(struct class *cls, struct class_device *parent, dev_t devt, struct device *device, char *fmt, ...) { @@ -47,7 +47,7 @@ static inline void class_device_destroy(struct class *cs, dev_t dev) (struct class *)class_simple_create(owner, name) #define class_destroy(cs) \ class_simple_destroy((struct class_simple *)(cs)) -#define CLASS_DEVICE_CREATE(cs, parent, dev, device, fmt...) \ +#define COMEDI_CLASS_DEVICE_CREATE(cs, parent, dev, device, fmt...) \ class_simple_device_add((struct class_simple *)(cs), \ dev, device, fmt) #define class_device_destroy(cs, dev) \ @@ -57,12 +57,12 @@ static inline void class_device_destroy(struct class *cs, dev_t dev) #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,15) -#define CLASS_DEVICE_CREATE(cs, parent, dev, device, fmt...) \ +#define COMEDI_CLASS_DEVICE_CREATE(cs, parent, dev, device, fmt...) \ class_device_create(cs, dev, device, fmt) #else -#define CLASS_DEVICE_CREATE(cs, parent, dev, device, fmt...) \ +#define COMEDI_CLASS_DEVICE_CREATE(cs, parent, dev, device, fmt...) \ class_device_create(cs, parent, dev, device, fmt) #endif // LINUX_VERSION_CODE < KERNEL_VERSION(2,6,15) -- 2.26.2