|
@@ -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);
|