From: Arjan van de Ven Date: Mon, 3 Jul 2006 07:25:22 +0000 (-0700) Subject: [PATCH] lockdep: annotate sound/core/seq/seq_device.c X-Git-Tag: firefly_0821_release~34425 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=933a2efc59513551dcfa7b814752dc581bd3c60b;p=firefly-linux-kernel-4.4.55.git [PATCH] lockdep: annotate sound/core/seq/seq_device.c The ops structure has complex locking rules, where not all ops are equal, some are subordinate on others for some complex sound cards. This requires for lockdep checking that each individual reg_mutex is considered in separation for its locking rules. Has no effect on non-lockdep kernels. Signed-off-by: Arjan van de Ven Cc: Ingo Molnar Cc: Takashi Iwai Cc: Jaroslav Kysela Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/sound/core/seq/seq_device.c b/sound/core/seq/seq_device.c index d812dc886360..4260de90f36f 100644 --- a/sound/core/seq/seq_device.c +++ b/sound/core/seq/seq_device.c @@ -380,6 +380,12 @@ static struct ops_list * create_driver(char *id) /* set up driver entry */ strlcpy(ops->id, id, sizeof(ops->id)); mutex_init(&ops->reg_mutex); + /* + * The ->reg_mutex locking rules are per-driver, so we create + * separate per-driver lock classes: + */ + lockdep_set_class(&ops->reg_mutex, (struct lock_class_key *)id); + ops->driver = DRIVER_EMPTY; INIT_LIST_HEAD(&ops->dev_list); /* lock this instance */