2003-07-07 16:34:41

by Flameeyes

[permalink] [raw]
Subject: [RFC] [PATCH] LIRC drivers for 2.5

The patch can be grabbed from
http://flameeyes.web.ctonet.it/patch-2.5.72-lirc.diff.bz2

This patch (that apply over .72+ but probably also in previous
versions), adds the LIRC drivers (http://lirc.sf.net/) from the cvs to
the kernel.
As userland tools can be used lirc (from cvs) build against a 2.4
kernel.
I've tested it with my tv card for some weeks and it works perfectly.

I hope can be useful.

[Sorry if this is a double message, my isp's mailserver has some problems, I receive an error back from it, but i'm not sure if it's true or a false warning. In case, sorry]

--
Flameeyes <[email protected]>


2003-07-08 10:04:31

by Zoltan Boszormenyi

[permalink] [raw]
Subject: Re: [RFC] [PATCH] LIRC drivers for 2.5

--- ./drivers/char/lirc/lirc_dev.c.old 2003-07-08 11:42:29.000000000 +0200
+++ ./drivers/char/lirc/lirc_dev.c 2003-07-08 11:45:16.000000000 +0200
@@ -307,7 +307,7 @@
}
up(&plugin_lock);

- MOD_INC_USE_COUNT;
+ try_module_get(THIS_MODULE);

dprintk("lirc_dev: plugin %s registered at minor number = %d\n",
ir->p.name, ir->p.minor);
@@ -377,7 +377,7 @@
init_irctl(ir);
up(&plugin_lock);

- MOD_DEC_USE_COUNT;
+ module_put(THIS_MODULE);

return SUCCESS;
}
--- ./drivers/char/lirc/lirc_gpio.c.old 2003-07-08 11:42:37.000000000 +0200
+++ ./drivers/char/lirc/lirc_gpio.c 2003-07-08 11:46:10.000000000 +0200
@@ -336,13 +336,13 @@

static int set_use_inc(void* data)
{
- MOD_INC_USE_COUNT;
+ try_module_get(THIS_MODULE);
return 0;
}

static void set_use_dec(void* data)
{
- MOD_DEC_USE_COUNT;
+ module_put(THIS_MODULE);
}

static wait_queue_head_t* get_queue(void* data)
--- ./drivers/char/lirc/lirc_it87.c.old 2003-07-08 11:42:44.000000000 +0200
+++ ./drivers/char/lirc/lirc_it87.c 2003-07-08 11:49:45.000000000 +0200
@@ -150,7 +150,7 @@
spin_unlock(&dev_lock);
return -EBUSY;
}
- MOD_INC_USE_COUNT;
+ try_module_get(THIS_MODULE);
spin_unlock(&dev_lock);
return 0;
}
@@ -159,7 +159,7 @@
static int lirc_close(struct inode * inode,
struct file *file)
{
- MOD_DEC_USE_COUNT;
+ module_put(THIS_MODULE);
return 0;
}

@@ -374,7 +374,7 @@
static int set_use_inc(void* data)
{
#if WE_DONT_USE_LOCAL_OPEN_CLOSE
- MOD_INC_USE_COUNT;
+ try_module_get(THIS_MODULE);
#endif
return 0;
}
@@ -382,7 +382,7 @@
static void set_use_dec(void* data)
{
#if WE_DONT_USE_LOCAL_OPEN_CLOSE
- MOD_DEC_USE_COUNT;
+ module_put(THIS_MODULE);
#endif
}
static struct lirc_plugin plugin = {
--- ./drivers/char/lirc/lirc_parallel.c.old 2003-07-08 11:42:52.000000000 +0200
+++ ./drivers/char/lirc/lirc_parallel.c 2003-07-08 11:50:47.000000000 +0200
@@ -547,7 +547,7 @@
rptr=wptr=0;
lost_irqs=0;

- MOD_INC_USE_COUNT;
+ try_module_get(THIS_MODULE);
is_open=1;
return(0);
}
@@ -560,7 +560,7 @@
parport_release(ppdevice);
}
is_open=0;
- MOD_DEC_USE_COUNT;
+ module_put(THIS_MODULE);
return(0);
}

@@ -578,7 +578,7 @@
static int set_use_inc(void* data)
{
#if WE_DONT_USE_LOCAL_OPEN_CLOSE
- MOD_INC_USE_COUNT;
+ try_module_get(THIS_MODULE);
#endif
return 0;
}
@@ -586,7 +586,7 @@
static void set_use_dec(void* data)
{
#if WE_DONT_USE_LOCAL_OPEN_CLOSE
- MOD_DEC_USE_COUNT;
+ module_put(THIS_MODULE);
#endif
}
static struct lirc_plugin plugin = {
--- ./drivers/char/lirc/lirc_serial.c.old 2003-07-08 11:42:58.000000000 +0200
+++ ./drivers/char/lirc/lirc_serial.c 2003-07-08 11:51:27.000000000 +0200
@@ -833,7 +833,7 @@
/* Init read buffer. */
lirc_buffer_init(&rbuf, sizeof(lirc_t), RBUF_LEN);

- MOD_INC_USE_COUNT;
+ try_module_get(THIS_MODULE);
spin_unlock(&lirc_lock);
return 0;
}
@@ -857,7 +857,7 @@
# endif
lirc_buffer_free(&rbuf);

- MOD_DEC_USE_COUNT;
+ module_put(THIS_MODULE);
}

static ssize_t lirc_write(struct file *file, const char *buf,


Attachments:
lirc-fixes.patch (3.02 kB)

2003-07-08 10:16:17

by Flameeyes

[permalink] [raw]
Subject: Re: [RFC] [PATCH] LIRC drivers for 2.5

On Tue, 2003-07-08 at 12:18, Boszormenyi Zoltan wrote:
> lirc_i2c.c does not compile:
I know this problem, lirc_i2c is using the i2c driver from lm_sensors
project, in the 2.4 version, so need a quite total rewrite.
--
Flameeyes <[email protected]>