Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 231867
Collapse All | Expand All

(-)a/drivers/kcompat.h (-10 / +30 lines)
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
{
(-)a/drivers/lirc_dev/lirc_dev.c (-6 / +8 lines)
Lines 17-23 Link Here
17
 *  along with this program; if not, write to the Free Software
17
 *  along with this program; if not, write to the Free Software
18
 *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
18
 *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19
 *
19
 *
20
 * $Id: lirc_dev.c,v 1.56 2008/01/13 10:45:02 lirc Exp $
20
 * $Id: lirc_dev.c,v 1.58 2008/05/14 16:37:49 lirc Exp $
21
 *
21
 *
22
 */
22
 */
23
23
Lines 145-151 Link Here
145
#ifdef LIRC_HAVE_DEVFS_26
145
#ifdef LIRC_HAVE_DEVFS_26
146
	devfs_remove(DEV_LIRC "/%u", ir->p.minor);
146
	devfs_remove(DEV_LIRC "/%u", ir->p.minor);
147
#endif
147
#endif
148
	class_device_destroy(lirc_class, MKDEV(IRCTL_DEV_MAJOR, ir->p.minor));
148
	lirc_device_destroy(lirc_class,
149
			    MKDEV(IRCTL_DEV_MAJOR, ir->p.minor));
149
150
150
	if (ir->buf != ir->p.rbuf) {
151
	if (ir->buf != ir->p.rbuf) {
151
		lirc_buffer_free(ir->buf);
152
		lirc_buffer_free(ir->buf);
Lines 400-408 Link Here
400
			S_IFCHR|S_IRUSR|S_IWUSR,
401
			S_IFCHR|S_IRUSR|S_IWUSR,
401
			DEV_LIRC "/%u", ir->p.minor);
402
			DEV_LIRC "/%u", ir->p.minor);
402
#endif
403
#endif
403
	(void) lirc_class_device_create(lirc_class, NULL,
404
	(void) lirc_device_create(lirc_class, ir->p.dev,
404
					MKDEV(IRCTL_DEV_MAJOR, ir->p.minor),
405
				  MKDEV(IRCTL_DEV_MAJOR, ir->p.minor),
405
					ir->p.dev, "lirc%u", ir->p.minor);
406
				  "lirc%u", ir->p.minor);
406
407
407
	if (p->sample_rate || p->get_queue) {
408
	if (p->sample_rate || p->get_queue) {
408
		/* try to fire up polling thread */
409
		/* try to fire up polling thread */
Lines 441-447 Link Here
441
	return minor;
442
	return minor;
442
443
443
out_sysfs:
444
out_sysfs:
444
	class_device_destroy(lirc_class, MKDEV(IRCTL_DEV_MAJOR, ir->p.minor));
445
	lirc_device_destroy(lirc_class,
446
			    MKDEV(IRCTL_DEV_MAJOR, ir->p.minor));
445
#ifdef LIRC_HAVE_DEVFS_24
447
#ifdef LIRC_HAVE_DEVFS_24
446
	devfs_unregister(ir->devfs_handle);
448
	devfs_unregister(ir->devfs_handle);
447
#endif
449
#endif

Return to bug 231867