linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC] [PATCH] LIRC drivers for 2.5
@ 2003-07-07 16:50 Flameeyes
  0 siblings, 0 replies; 3+ messages in thread
From: Flameeyes @ 2003-07-07 16:50 UTC (permalink / raw)
  To: linux-kernel

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 <dgp85@users.sf.net>


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [RFC] [PATCH] LIRC drivers for 2.5
  2003-07-08 10:18 Boszormenyi Zoltan
@ 2003-07-08 10:31 ` Flameeyes
  0 siblings, 0 replies; 3+ messages in thread
From: Flameeyes @ 2003-07-08 10:31 UTC (permalink / raw)
  To: Boszormenyi Zoltan; +Cc: linux-kernel

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 <dgp85@users.sf.net>


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [RFC] [PATCH] LIRC drivers for 2.5
@ 2003-07-08 10:18 Boszormenyi Zoltan
  2003-07-08 10:31 ` Flameeyes
  0 siblings, 1 reply; 3+ messages in thread
From: Boszormenyi Zoltan @ 2003-07-08 10:18 UTC (permalink / raw)
  To: dgp85; +Cc: linux-kernel

[-- Attachment #1: Type: text/plain, Size: 3937 bytes --]

Hi,

I tried to compile it  but at first only lirc_sir.c compiled.
The drivers/char/lirc/Makefile contains

obj-$(LIRC_NNN) := lirc_nnn.o

lines. These override any previously defined obj-y or obj-m defines.
These lines should be

obj-$(LIRC_NNN) += lirc_nnn.o

instead.

lirc_i2c.c does not compile:

drivers/char/lirc/lirc_i2c.c: In function `get_key_asus':
drivers/char/lirc/lirc_i2c.c:106: structure has no member named `name'
drivers/char/lirc/lirc_i2c.c:117: structure has no member named `name'
drivers/char/lirc/lirc_i2c.c: In function `set_use_inc':
drivers/char/lirc/lirc_i2c.c:251: structure has no member named `inc_use'
drivers/char/lirc/lirc_i2c.c:252: structure has no member named `inc_use'
drivers/char/lirc/lirc_i2c.c:254: warning: `MOD_INC_USE_COUNT' is
deprecated (declared at include/linux/module.h:481)
drivers/char/lirc/lirc_i2c.c: In function `set_use_dec':
drivers/char/lirc/lirc_i2c.c:262: structure has no member named `dec_use'
drivers/char/lirc/lirc_i2c.c:263: structure has no member named `dec_use'
drivers/char/lirc/lirc_i2c.c:264: warning: `MOD_DEC_USE_COUNT' is
deprecated (declared at include/linux/module.h:493)
drivers/char/lirc/lirc_i2c.c: At top level:
drivers/char/lirc/lirc_i2c.c:292: unknown field `name' specified in
initializer
drivers/char/lirc/lirc_i2c.c:292: warning: initialization makes integer
from pointer without a cast
drivers/char/lirc/lirc_i2c.c: In function `ir_attach':
drivers/char/lirc/lirc_i2c.c:311: structure has no member named `data'
drivers/char/lirc/lirc_i2c.c:320: structure has no member named `name'
drivers/char/lirc/lirc_i2c.c:325: structure has no member named `name'
drivers/char/lirc/lirc_i2c.c:331: structure has no member named `name'
drivers/char/lirc/lirc_i2c.c:336: structure has no member named `name'
drivers/char/lirc/lirc_i2c.c:342: structure has no member named `name'
drivers/char/lirc/lirc_i2c.c:353: structure has no member named `name'
drivers/char/lirc/lirc_i2c.c:358: structure has no member named `inc_use'
drivers/char/lirc/lirc_i2c.c:359: structure has no member named `inc_use'
drivers/char/lirc/lirc_i2c.c: In function `ir_detach':
drivers/char/lirc/lirc_i2c.c:366: structure has no member named `data'
drivers/char/lirc/lirc_i2c.c:369: structure has no member named `dec_use'
drivers/char/lirc/lirc_i2c.c:370: structure has no member named `dec_use'
drivers/char/lirc/lirc_i2c.c: In function `ir_probe':
drivers/char/lirc/lirc_i2c.c:400: structure has no member named `name'
drivers/char/lirc/lirc_i2c.c:444: structure has no member named `name'
drivers/char/lirc/lirc_i2c.c: At top level:
drivers/char/lirc/lirc_i2c.c:459: parse error before "lirc_i2c_init"
drivers/char/lirc/lirc_i2c.c:460: warning: return type defaults to `int'
drivers/char/lirc/lirc_i2c.c:467: parse error before "lirc_i2c_exit"
drivers/char/lirc/lirc_i2c.c:468: warning: return type defaults to `int'
drivers/char/lirc/lirc_i2c.c:477: warning: type defaults to `int' in
declaration of `module_init'
drivers/char/lirc/lirc_i2c.c:477: warning: parameter names (without
types) in function declaration
drivers/char/lirc/lirc_i2c.c:477: warning: data definition has no type
or storage class
drivers/char/lirc/lirc_i2c.c:478: warning: type defaults to `int' in
declaration of `module_exit'
drivers/char/lirc/lirc_i2c.c:478: warning: parameter names (without
types) in function declaration
drivers/char/lirc/lirc_i2c.c:478: warning: data definition has no type
or storage class
make[3]: *** [drivers/char/lirc/lirc_i2c.o] Error 1
make[2]: *** [drivers/char/lirc] Error 2
make[1]: *** [drivers/char] Error 2
make: *** [drivers] Error 2

And don't use MOD_[DEC|INC]_USE_COUNT on late 2.5.x,
they are deprecated. Use try_module_get()/module_put() instead.
I tried to fix them, the patch is attached.

Here are all the warnings after my fixes:


-- 
Best regards,
Zoltán Böszörményi

---------------------
What did Hussein say about his knife?
One in Bush worth two in the hand.

[-- Attachment #2: lirc-fixes.patch --]
[-- Type: text/plain, Size: 3094 bytes --]

--- ./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,


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2003-07-08 10:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-07-07 16:50 [RFC] [PATCH] LIRC drivers for 2.5 Flameeyes
2003-07-08 10:18 Boszormenyi Zoltan
2003-07-08 10:31 ` Flameeyes

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).