提交 6dbbf846 编写于 作者: E Edmond Chung 提交者: Bartosz Golaszewski

gpiolib: Don't free if pin ranges are not defined

A similar check was added in gpiochip_generic_request, but not in free.
This has caused an imbalance count of request vs. free calls to the
pinctrl driver. This patch is targeted to fix that issue.

Fixes: 2ab73c6d ("gpio: Support GPIO controllers without pin-ranges")
Signed-off-by: NEdmond Chung <edmondchung@google.com>
Signed-off-by: NAndrew Chant <achant@google.com>
Signed-off-by: NWill McVicker <willmcvicker@google.com>
Signed-off-by: NBartosz Golaszewski <bgolaszewski@baylibre.com>
上级 60593df6
无相关合并请求
......@@ -1806,6 +1806,11 @@ EXPORT_SYMBOL_GPL(gpiochip_generic_request);
*/
void gpiochip_generic_free(struct gpio_chip *gc, unsigned offset)
{
#ifdef CONFIG_PINCTRL
if (list_empty(&gc->gpiodev->pin_ranges))
return;
#endif
pinctrl_gpio_free(gc->gpiodev->base + offset);
}
EXPORT_SYMBOL_GPL(gpiochip_generic_free);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册
反馈
建议
客服 返回
顶部