Lines 1-4
Link Here
|
1 |
/* $Id: kcompat.h,v 5.34 2008/01/13 10:26:28 lirc Exp $ */ |
1 |
/* $Id: kcompat.h,v 5.36 2008/05/14 16:37:49 lirc Exp $ */ |
2 |
|
2 |
|
3 |
#ifndef _KCOMPAT_H |
3 |
#ifndef _KCOMPAT_H |
4 |
#define _KCOMPAT_H |
4 |
#define _KCOMPAT_H |
Lines 36-45
Link Here
|
36 |
class_simple_destroy(cls); |
36 |
class_simple_destroy(cls); |
37 |
} |
37 |
} |
38 |
|
38 |
|
39 |
#define lirc_class_device_create(cs, parent, dev, device, fmt, args...) \ |
39 |
#define lirc_device_create(cs, parent, dev, fmt, args...) \ |
40 |
class_simple_device_add(cs, dev, device, fmt, ## args) |
40 |
class_simple_device_add(cs, dev, parent, fmt, ## args) |
41 |
|
41 |
|
42 |
static inline void class_device_destroy(lirc_class_t *cls, dev_t devt) |
42 |
static inline void lirc_device_destroy(lirc_class_t *cls, dev_t devt) |
43 |
{ |
43 |
{ |
44 |
class_simple_device_remove(devt); |
44 |
class_simple_device_remove(devt); |
45 |
} |
45 |
} |
Lines 48-67
Link Here
|
48 |
|
48 |
|
49 |
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 15) |
49 |
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 15) |
50 |
|
50 |
|
51 |
#define lirc_class_device_create(cs, parent, dev, device, fmt, args...) \ |
51 |
#define lirc_device_create(cs, parent, dev, fmt, args...) \ |
52 |
class_device_create(cs, dev, device, fmt, ## args) |
52 |
class_device_create(cs, dev, parent, fmt, ## args) |
53 |
|
53 |
|
54 |
#else /* >= 2.6.15 */ |
54 |
#else /* >= 2.6.15 */ |
55 |
|
55 |
|
56 |
#define lirc_class_device_create class_device_create |
56 |
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 26) |
|
|
57 |
|
58 |
#define lirc_device_create(cs, parent, dev, fmt, args...) \ |
59 |
class_device_create(cs, NULL, dev, parent, fmt, ## args) |
60 |
|
61 |
#else /* >= 2.6.26 */ |
62 |
|
63 |
#define lirc_device_create device_create |
64 |
|
65 |
#endif /* >= 2.6.26 */ |
66 |
|
57 |
#define LIRC_DEVFS_PREFIX |
67 |
#define LIRC_DEVFS_PREFIX |
58 |
|
68 |
|
59 |
#endif |
69 |
#endif /* >= 2.6.15 */ |
60 |
|
70 |
|
61 |
typedef struct class lirc_class_t; |
71 |
typedef struct class lirc_class_t; |
62 |
|
72 |
|
|
|
73 |
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 26) |
74 |
|
75 |
#define lirc_device_destroy class_device_destroy |
76 |
|
77 |
#else |
78 |
|
79 |
#define lirc_device_destroy device_destroy |
80 |
|
63 |
#endif |
81 |
#endif |
64 |
|
82 |
|
|
|
83 |
#endif /* >= 2.6.13 */ |
84 |
|
65 |
#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 4, 0) |
85 |
#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 4, 0) |
66 |
#define LIRC_HAVE_DEVFS |
86 |
#define LIRC_HAVE_DEVFS |
67 |
#define LIRC_HAVE_DEVFS_24 |
87 |
#define LIRC_HAVE_DEVFS_24 |
Lines 133-140
Link Here
|
133 |
#ifndef LIRC_HAVE_SYSFS |
153 |
#ifndef LIRC_HAVE_SYSFS |
134 |
#define class_destroy(x) do { } while (0) |
154 |
#define class_destroy(x) do { } while (0) |
135 |
#define class_create(x, y) NULL |
155 |
#define class_create(x, y) NULL |
136 |
#define class_device_destroy(x, y) do { } while (0) |
156 |
#define lirc_class_destroy(x, y) do { } while (0) |
137 |
#define lirc_class_device_create(x, y, z, xx, yy, zz) 0 |
157 |
#define lirc_class_create(x, y, z, xx, yy, zz) 0 |
138 |
#define IS_ERR(x) 0 |
158 |
#define IS_ERR(x) 0 |
139 |
typedef struct class_simple |
159 |
typedef struct class_simple |
140 |
{ |
160 |
{ |