From: Jeff Garzik <jeff@garzik.org>
To: LKML <linux-kernel@vger.kernel.org>
Cc: dtor@mail.ru
Subject: [PATCH 10/17] drivers/input/serio/i8042.c: irq handler clean
Date: Sun, 21 Oct 2007 03:52:37 -0400 (EDT) [thread overview]
Message-ID: <20071021075237.EC51B19041D@havoc.gtf.org> (raw)
In-Reply-To: <lkjvxcz09835mnsdfv0983q4m1234m@havoc.gtf.org>
commit bdf311215ef8dbae0254c092deaed1d5928b013e
Author: Jeff Garzik <jeff@garzik.org>
Date: Fri Oct 19 19:28:54 2007 -0400
drivers/input/serio/i8042.c: irq handler clean
* remove unnecessary prototype
* distinguish between polled and irq-driven event handling
* don't bother worrying about 'irq' function arg
* dev_id passed to irq handlers is unused, to change the request_irq()
argument to NULL
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
drivers/input/serio/i8042.c | 23 +++++++++++++----------
1 file changed, 13 insertions(+), 10 deletions(-)
bdf311215ef8dbae0254c092deaed1d5928b013e
diff --git a/drivers/input/serio/i8042.c b/drivers/input/serio/i8042.c
index 11dafc0..51c57f0 100644
--- a/drivers/input/serio/i8042.c
+++ b/drivers/input/serio/i8042.c
@@ -102,8 +102,6 @@ static unsigned char i8042_aux_irq_registered;
static unsigned char i8042_suppress_kbd_ack;
static struct platform_device *i8042_platform_device;
-static irqreturn_t i8042_interrupt(int irq, void *dev_id);
-
/*
* The i8042_wait_read() and i8042_wait_write functions wait for the i8042 to
* be ready for reading values from it / writing values to it.
@@ -288,7 +286,7 @@ static void i8042_stop(struct serio *serio)
* to the upper layers.
*/
-static irqreturn_t i8042_interrupt(int irq, void *dev_id)
+static irqreturn_t __i8042_interrupt(bool polled)
{
struct i8042_port *port;
unsigned long flags;
@@ -301,7 +299,7 @@ static irqreturn_t i8042_interrupt(int irq, void *dev_id)
str = i8042_read_status();
if (unlikely(~str & I8042_STR_OBF)) {
spin_unlock_irqrestore(&i8042_lock, flags);
- if (irq) dbg("Interrupt %d, without any data", irq);
+ if (!polled) dbg("Interrupt without any data");
ret = 0;
goto out;
}
@@ -356,8 +354,8 @@ static irqreturn_t i8042_interrupt(int irq, void *dev_id)
port = &i8042_ports[port_no];
- dbg("%02x <- i8042 (interrupt, %d, %d%s%s)",
- data, port_no, irq,
+ dbg("%02x <- i8042 (interrupt, %d, %s%s)",
+ data, port_no,
dfl & SERIO_PARITY ? ", bad parity" : "",
dfl & SERIO_TIMEOUT ? ", timeout" : "");
@@ -375,6 +373,11 @@ static irqreturn_t i8042_interrupt(int irq, void *dev_id)
return IRQ_RETVAL(ret);
}
+static irqreturn_t i8042_interrupt(int dummy, void *dev_id)
+{
+ return __i8042_interrupt(false);
+}
+
/*
* i8042_enable_kbd_port enables keybaord port on chip
*/
@@ -636,7 +639,7 @@ static int __devinit i8042_check_aux(void)
}
if (request_irq(I8042_AUX_IRQ, i8042_aux_test_irq, IRQF_SHARED,
- "i8042", i8042_platform_device))
+ "i8042", NULL))
goto out;
irq_registered = 1;
@@ -939,7 +942,7 @@ static int i8042_resume(struct platform_device *dev)
if (i8042_ports[I8042_KBD_PORT_NO].serio)
i8042_enable_kbd_port();
- i8042_interrupt(0, NULL);
+ __i8042_interrupt(true);
dev->dev.power.power_state = PMSG_ON;
@@ -1090,7 +1093,7 @@ static int __devinit i8042_setup_aux(void)
}
error = request_irq(I8042_AUX_IRQ, i8042_interrupt, IRQF_SHARED,
- "i8042", i8042_platform_device);
+ "i8042", NULL);
if (error)
goto err_free_ports;
@@ -1116,7 +1119,7 @@ static int __devinit i8042_setup_kbd(void)
return error;
error = request_irq(I8042_KBD_IRQ, i8042_interrupt, IRQF_SHARED,
- "i8042", i8042_platform_device);
+ "i8042", NULL);
if (error)
goto err_free_port;
next prev parent reply other threads:[~2007-10-21 7:55 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-10-21 7:52 [PATCH 0/17] various irq handler cleanups Jeff Garzik
2007-10-21 7:52 ` [PATCH 1/17] " Jeff Garzik
2007-10-21 7:52 ` [PATCH 2/17] drivers/char/ip2: split out irq core logic into separate function Jeff Garzik
2007-10-21 7:52 ` [PATCH 3/17] drivers/char/ip2: separate polling and irq-driven work entry points Jeff Garzik
2007-10-21 7:52 ` [PATCH 4/17] char/pcmcia/synclink_cs: trim trailing whitespace Jeff Garzik
2007-10-21 7:52 ` [PATCH 5/17] drivers/char/pcmcia/synclink_cs.c: irq handler cleanups Jeff Garzik
2007-10-21 7:52 ` [PATCH 6/17] drivers/char/riscom8: " Jeff Garzik
2007-10-21 9:01 ` Jiri Slaby
2007-10-21 9:06 ` Jeff Garzik
2007-10-21 7:52 ` [PATCH 7/17] drivers/char/{rio,specialix,sx}: " Jeff Garzik
2007-10-21 7:52 ` [PATCH 8/17] arch/x86/kernel/vm86_32.c: irq handler cleanup Jeff Garzik
2007-10-21 9:21 ` Thomas Gleixner
2007-10-21 7:52 ` [PATCH 9/17] drivers/char/{synclink,tpm}: irq handler cleanups Jeff Garzik
2007-10-21 7:52 ` Jeff Garzik [this message]
2007-10-21 17:57 ` [PATCH 10/17] drivers/input/serio/i8042.c: irq handler clean Dmitry Torokhov
2007-10-30 12:36 ` Jeff Garzik
2007-10-21 7:52 ` [PATCH 11/17] isdn/act2000: fix major bug. clean irq handler Jeff Garzik
2007-10-21 7:52 ` [PATCH 12/17] isdn/sc: irq handler clean Jeff Garzik
2007-10-21 7:52 ` [PATCH 13/17] netdrvr irq handler cleanups Jeff Garzik
2007-10-21 7:52 ` [PATCH 14/17] pcmcia/i82365: " Jeff Garzik
2007-10-21 7:52 ` [PATCH 15/17] serial, rtc/ds1374: " Jeff Garzik
2007-10-21 7:52 ` [PATCH 16/17] SCSI: driver " Jeff Garzik
2007-10-21 7:52 ` [PATCH 17/17] RTC interrupt handling cleanups Jeff Garzik
2007-10-21 16:40 ` Mike Frysinger
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20071021075237.EC51B19041D@havoc.gtf.org \
--to=jeff@garzik.org \
--cc=dtor@mail.ru \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®