1 Kernel 2.6.26 removes an API previously used by lirc:
2 - http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=c3b19ff06e0808555403491d61e8f0cbbb53e933
4 * add compatibility patch for kernels >= 2.6.26, based on upstream CVS.
5 - http://lirc.cvs.sourceforge.net/lirc/lirc/drivers/kcompat.h?r1=5.34&r2=5.36
6 - http://lirc.cvs.sourceforge.net/lirc/lirc/drivers/lirc_dev/lirc_dev.c?r1=1.57&r2=1.58
8 Copyright: (C) 2008 Christoph Bartelmus <lirc@bartelmus.de>
10 --- a/drivers/kcompat.h
11 +++ b/drivers/kcompat.h
13 class_simple_destroy(cls);
16 -#define lirc_class_device_create(cs, parent, dev, device, fmt, args...) \
17 - class_simple_device_add(cs, dev, device, fmt, ## args)
18 +#define lirc_device_create(cs, parent, dev, fmt, args...) \
19 + class_simple_device_add(cs, dev, parent, fmt, ## args)
21 -static inline void class_device_destroy(lirc_class_t *cls, dev_t devt)
22 +static inline void lirc_device_destroy(lirc_class_t *cls, dev_t devt)
24 class_simple_device_remove(devt);
28 #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 15)
30 -#define lirc_class_device_create(cs, parent, dev, device, fmt, args...) \
31 - class_device_create(cs, dev, device, fmt, ## args)
32 +#define lirc_device_create(cs, parent, dev, fmt, args...) \
33 + class_device_create(cs, dev, parent, fmt, ## args)
37 -#define lirc_class_device_create class_device_create
38 +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 26)
40 +#define lirc_device_create(cs, parent, dev, fmt, args...) \
41 + class_device_create(cs, NULL, dev, parent, fmt, ## args)
43 +#else /* >= 2.6.26 */
45 +#define lirc_device_create device_create
47 +#endif /* >= 2.6.26 */
49 #define LIRC_DEVFS_PREFIX
52 +#endif /* >= 2.6.15 */
54 typedef struct class lirc_class_t;
56 +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 26)
58 +#define lirc_device_destroy class_device_destroy
62 +#define lirc_device_destroy device_destroy
66 +#endif /* >= 2.6.13 */
68 #elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 4, 0)
69 #define LIRC_HAVE_DEVFS
70 #define LIRC_HAVE_DEVFS_24
72 #ifndef LIRC_HAVE_SYSFS
73 #define class_destroy(x) do { } while (0)
74 #define class_create(x, y) NULL
75 -#define class_device_destroy(x, y) do { } while (0)
76 -#define lirc_class_device_create(x, y, z, xx, yy, zz) 0
77 +#define lirc_class_destroy(x, y) do { } while (0)
78 +#define lirc_class_create(x, y, z, xx, yy, zz) 0
80 typedef struct class_simple
82 --- a/drivers/lirc_dev/lirc_dev.c
83 +++ b/drivers/lirc_dev/lirc_dev.c
85 #ifdef LIRC_HAVE_DEVFS_26
86 devfs_remove(DEV_LIRC "/%u", ir->p.minor);
88 - class_device_destroy(lirc_class, MKDEV(IRCTL_DEV_MAJOR, ir->p.minor));
89 + lirc_device_destroy(lirc_class,
90 + MKDEV(IRCTL_DEV_MAJOR, ir->p.minor));
92 if (ir->buf != ir->p.rbuf) {
93 lirc_buffer_free(ir->buf);
95 S_IFCHR|S_IRUSR|S_IWUSR,
96 DEV_LIRC "/%u", ir->p.minor);
98 - (void) lirc_class_device_create(lirc_class, NULL,
99 - MKDEV(IRCTL_DEV_MAJOR, ir->p.minor),
100 - ir->p.dev, "lirc%u", ir->p.minor);
101 + (void) lirc_device_create(lirc_class, ir->p.dev,
102 + MKDEV(IRCTL_DEV_MAJOR, ir->p.minor),
103 + "lirc%u", ir->p.minor);
105 if (p->sample_rate || p->get_queue) {
106 /* try to fire up polling thread */
111 - class_device_destroy(lirc_class, MKDEV(IRCTL_DEV_MAJOR, ir->p.minor));
112 + lirc_device_destroy(lirc_class,
113 + MKDEV(IRCTL_DEV_MAJOR, ir->p.minor));
114 #ifdef LIRC_HAVE_DEVFS_24
115 devfs_unregister(ir->devfs_handle);