[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1376829629.3391.5.camel@phoenix>
Date: Sun, 18 Aug 2013 20:40:29 +0800
From: Axel Lin <axel.lin@...ics.com>
To: Linus Walleij <linus.walleij@...aro.org>
Cc: Haojian Zhuang <haojian.zhuang@...aro.org>,
linux-kernel@...r.kernel.org
Subject: [PATCH 2/2] pinctrl: core: Hold pctldev->mutex mutex lock while
traversing gpio_ranges list
Hold pctldev->mutex mutex_lock when traverse the list.
Signed-off-by: Axel Lin <axel.lin@...ics.com>
---
drivers/pinctrl/core.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/pinctrl/core.c b/drivers/pinctrl/core.c
index c670527..4adef2f 100644
--- a/drivers/pinctrl/core.c
+++ b/drivers/pinctrl/core.c
@@ -357,14 +357,17 @@ static bool pinctrl_ready_for_gpio_range(unsigned gpio)
/* Loop over the pin controllers */
list_for_each_entry(pctldev, &pinctrldev_list, node) {
/* Loop over the ranges */
+ mutex_lock(&pctldev->mutex);
list_for_each_entry(range, &pctldev->gpio_ranges, node) {
/* Check if any gpio range overlapped with gpio chip */
if (range->base + range->npins - 1 < chip->base ||
range->base > chip->base + chip->ngpio - 1)
continue;
+ mutex_unlock(&pctldev->mutex);
mutex_unlock(&pinctrldev_list_mutex);
return true;
}
+ mutex_unlock(&pctldev->mutex);
}
mutex_unlock(&pinctrldev_list_mutex);
--
1.8.1.2
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists