Commit 740f5b08 authored by Andrzej Hajda's avatar Andrzej Hajda Committed by Linus Walleij

pinctrl: mediatek: fix handling return value of mtk_pmx_find_gpio_mode

The function can return negative values, so its result should
be assigned to signed variable.

The problem has been detected using coccinelle semantic patch
scripts/coccinelle/tests/assign_signed_to_unsigned.cocci.

Fixes: 59ee9c96 ('pinctrl: mediatek: Add gpio_request_enable support')
Signed-off-by: default avatarAndrzej Hajda <a.hajda@samsung.com>
Acked-by: default avatarHongzhou Yang <hongzhou.yang@mediatek.com>
Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
parent 337ea0fb
......@@ -753,7 +753,7 @@ static int mtk_pmx_gpio_request_enable(struct pinctrl_dev *pctldev,
struct pinctrl_gpio_range *range,
unsigned offset)
{
unsigned long muxval;
int muxval;
struct mtk_pinctrl *pctl = pinctrl_dev_get_drvdata(pctldev);
muxval = mtk_pmx_find_gpio_mode(pctl, offset);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment