From 14d822185d6e69fd7caf04ea7d75080208e55889 Mon Sep 17 00:00:00 2001 From: Oliver Hartkopp Date: Wed, 19 May 2010 06:46:38 +0000 Subject: [PATCH] can: SJA1000 add missing spin_lock_init() As remarked by Sam Ravnborg the spin_lock variable, that has been introduced in commit 5134a719d9986a9e9545b818f47eef089552bf86 ("can: Fix SJA1000 command register writes on SMP systems") has not been initialized properly. This patch adds the initialization to allow spinlock debugging. Signed-off-by: Oliver Hartkopp CC: Sam Ravnborg Signed-off-by: David S. Miller --- drivers/net/can/sja1000/sja1000.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/can/sja1000/sja1000.c b/drivers/net/can/sja1000/sja1000.c index 85f7cbfe8e5fb..0a8de01d52f7a 100644 --- a/drivers/net/can/sja1000/sja1000.c +++ b/drivers/net/can/sja1000/sja1000.c @@ -599,6 +599,8 @@ struct net_device *alloc_sja1000dev(int sizeof_priv) priv->can.ctrlmode_supported = CAN_CTRLMODE_3_SAMPLES | CAN_CTRLMODE_BERR_REPORTING; + spin_lock_init(&priv->cmdreg_lock); + if (sizeof_priv) priv->priv = (void *)priv + sizeof(struct sja1000_priv); -- 2.39.5