projects
/
powerpc.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge git://git.kernel.org/pub/scm/linux/kernel/git/sfrench/cifs-2.6
[powerpc.git]
/
drivers
/
input
/
joystick
/
twidjoy.c
diff --git
a/drivers/input/joystick/twidjoy.c
b/drivers/input/joystick/twidjoy.c
index
7f8b009
..
9cf17d6
100644
(file)
--- a/
drivers/input/joystick/twidjoy.c
+++ b/
drivers/input/joystick/twidjoy.c
@@
-104,7
+104,7
@@
struct twidjoy {
* Twiddler. It updates the data accordingly.
*/
* Twiddler. It updates the data accordingly.
*/
-static void twidjoy_process_packet(struct twidjoy *twidjoy
, struct pt_regs *regs
)
+static void twidjoy_process_packet(struct twidjoy *twidjoy)
{
struct input_dev *dev = twidjoy->dev;
unsigned char *data = twidjoy->data;
{
struct input_dev *dev = twidjoy->dev;
unsigned char *data = twidjoy->data;
@@
-113,8
+113,6
@@
static void twidjoy_process_packet(struct twidjoy *twidjoy, struct pt_regs *regs
button_bits = ((data[1] & 0x7f) << 7) | (data[0] & 0x7f);
button_bits = ((data[1] & 0x7f) << 7) | (data[0] & 0x7f);
- input_regs(dev, regs);
-
for (bp = twidjoy_buttons; bp->bitmask; bp++) {
int value = (button_bits & (bp->bitmask << bp->bitshift)) >> bp->bitshift;
int i;
for (bp = twidjoy_buttons; bp->bitmask; bp++) {
int value = (button_bits & (bp->bitmask << bp->bitshift)) >> bp->bitshift;
int i;
@@
-141,7
+139,7
@@
static void twidjoy_process_packet(struct twidjoy *twidjoy, struct pt_regs *regs
* packet processing routine.
*/
* packet processing routine.
*/
-static irqreturn_t twidjoy_interrupt(struct serio *serio, unsigned char data, unsigned int flags
, struct pt_regs *regs
)
+static irqreturn_t twidjoy_interrupt(struct serio *serio, unsigned char data, unsigned int flags)
{
struct twidjoy *twidjoy = serio_get_drvdata(serio);
{
struct twidjoy *twidjoy = serio_get_drvdata(serio);
@@
-158,7
+156,7
@@
static irqreturn_t twidjoy_interrupt(struct serio *serio, unsigned char data, un
twidjoy->data[twidjoy->idx++] = data;
if (twidjoy->idx == TWIDJOY_MAX_LENGTH) {
twidjoy->data[twidjoy->idx++] = data;
if (twidjoy->idx == TWIDJOY_MAX_LENGTH) {
- twidjoy_process_packet(twidjoy
, regs
);
+ twidjoy_process_packet(twidjoy);
twidjoy->idx = 0;
}
twidjoy->idx = 0;
}
@@
-196,10
+194,10
@@
static int twidjoy_connect(struct serio *serio, struct serio_driver *drv)
twidjoy = kzalloc(sizeof(struct twidjoy), GFP_KERNEL);
input_dev = input_allocate_device();
if (!twidjoy || !input_dev)
twidjoy = kzalloc(sizeof(struct twidjoy), GFP_KERNEL);
input_dev = input_allocate_device();
if (!twidjoy || !input_dev)
- goto fail;
+ goto fail
1
;
twidjoy->dev = input_dev;
twidjoy->dev = input_dev;
- s
printf(twidjoy->phys
, "%s/input0", serio->phys);
+ s
nprintf(twidjoy->phys, sizeof(twidjoy->phys)
, "%s/input0", serio->phys);
input_dev->name = "Handykey Twiddler";
input_dev->phys = twidjoy->phys;
input_dev->name = "Handykey Twiddler";
input_dev->phys = twidjoy->phys;
@@
-223,13
+221,17
@@
static int twidjoy_connect(struct serio *serio, struct serio_driver *drv)
err = serio_open(serio, drv);
if (err)
err = serio_open(serio, drv);
if (err)
- goto fail;
+ goto fail2;
+
+ err = input_register_device(twidjoy->dev);
+ if (err)
+ goto fail3;
- input_register_device(twidjoy->dev);
return 0;
return 0;
- fail: serio_set_drvdata(serio, NULL);
- input_free_device(input_dev);
+ fail3: serio_close(serio);
+ fail2: serio_set_drvdata(serio, NULL);
+ fail1: input_free_device(input_dev);
kfree(twidjoy);
return err;
}
kfree(twidjoy);
return err;
}
@@
-267,8
+269,7
@@
static struct serio_driver twidjoy_drv = {
static int __init twidjoy_init(void)
{
static int __init twidjoy_init(void)
{
- serio_register_driver(&twidjoy_drv);
- return 0;
+ return serio_register_driver(&twidjoy_drv);
}
static void __exit twidjoy_exit(void)
}
static void __exit twidjoy_exit(void)