aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJiri Kosina <jikos@jikos.cz>2006-10-11 01:45:31 -0400
committerDmitry Torokhov <dtor@insightbb.com>2006-10-11 01:45:31 -0400
commit88aa0103e408616e433c209e80169ab8d6eda99e (patch)
treee3fa51949b0b38200c732a2f8796cb068d293a62
parent4dfbb9d8c6cbfc32faa5c71145bd2a43e1f8237c (diff)
Input: serio - add lockdep annotations
Signed-off-by: Jiri Kosina <jikos@jikos.cz> Acked-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
-rw-r--r--drivers/input/serio/libps2.c3
-rw-r--r--drivers/input/serio/serio.c6
-rw-r--r--include/linux/serio.h1
3 files changed, 8 insertions, 2 deletions
diff --git a/drivers/input/serio/libps2.c b/drivers/input/serio/libps2.c
index dcb16b5cbec0..e5b1b60757bb 100644
--- a/drivers/input/serio/libps2.c
+++ b/drivers/input/serio/libps2.c
@@ -189,7 +189,7 @@ int ps2_command(struct ps2dev *ps2dev, unsigned char *param, int command)
189 return -1; 189 return -1;
190 } 190 }
191 191
192 mutex_lock_nested(&ps2dev->cmd_mutex, SINGLE_DEPTH_NESTING); 192 mutex_lock(&ps2dev->cmd_mutex);
193 193
194 serio_pause_rx(ps2dev->serio); 194 serio_pause_rx(ps2dev->serio);
195 ps2dev->flags = command == PS2_CMD_GETID ? PS2_FLAG_WAITID : 0; 195 ps2dev->flags = command == PS2_CMD_GETID ? PS2_FLAG_WAITID : 0;
@@ -296,6 +296,7 @@ EXPORT_SYMBOL(ps2_schedule_command);
296void ps2_init(struct ps2dev *ps2dev, struct serio *serio) 296void ps2_init(struct ps2dev *ps2dev, struct serio *serio)
297{ 297{
298 mutex_init(&ps2dev->cmd_mutex); 298 mutex_init(&ps2dev->cmd_mutex);
299 lockdep_set_subclass(&ps2dev->cmd_mutex, serio->depth);
299 init_waitqueue_head(&ps2dev->wait); 300 init_waitqueue_head(&ps2dev->wait);
300 ps2dev->serio = serio; 301 ps2dev->serio = serio;
301} 302}
diff --git a/drivers/input/serio/serio.c b/drivers/input/serio/serio.c
index 960fae3c3cea..480fdc5d20b3 100644
--- a/drivers/input/serio/serio.c
+++ b/drivers/input/serio/serio.c
@@ -538,8 +538,12 @@ static void serio_init_port(struct serio *serio)
538 "serio%ld", (long)atomic_inc_return(&serio_no) - 1); 538 "serio%ld", (long)atomic_inc_return(&serio_no) - 1);
539 serio->dev.bus = &serio_bus; 539 serio->dev.bus = &serio_bus;
540 serio->dev.release = serio_release_port; 540 serio->dev.release = serio_release_port;
541 if (serio->parent) 541 if (serio->parent) {
542 serio->dev.parent = &serio->parent->dev; 542 serio->dev.parent = &serio->parent->dev;
543 serio->depth = serio->parent->depth + 1;
544 } else
545 serio->depth = 0;
546 lockdep_set_subclass(&serio->lock, serio->depth);
543} 547}
544 548
545/* 549/*
diff --git a/include/linux/serio.h b/include/linux/serio.h
index 3a697cc6ecae..b99c5ca9708d 100644
--- a/include/linux/serio.h
+++ b/include/linux/serio.h
@@ -41,6 +41,7 @@ struct serio {
41 void (*stop)(struct serio *); 41 void (*stop)(struct serio *);
42 42
43 struct serio *parent, *child; 43 struct serio *parent, *child;
44 unsigned int depth; /* level of nesting in serio hierarchy */
44 45
45 struct serio_driver *drv; /* accessed from interrupt, must be protected by serio->lock and serio->sem */ 46 struct serio_driver *drv; /* accessed from interrupt, must be protected by serio->lock and serio->sem */
46 struct mutex drv_mutex; /* protects serio->drv so attributes can pin driver */ 47 struct mutex drv_mutex; /* protects serio->drv so attributes can pin driver */