mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-08 11:50:43 +09:00
pinctrl: single: Fix incorrect type for error return variable
[ Upstream commit 61d1bb53547d42c6bdaec9da4496beb3a1a05264 ]
pcs_pinconf_get() and pcs_pinconf_set() declare ret as unsigned int,
but assign it the return values of pcs_get_function() that may return
negative error codes. This causes negative error codes to be
converted to large positive values.
Change ret from unsigned int to int in both functions.
Fixes: 9dddb4df90 ("pinctrl: single: support generic pinconf")
Signed-off-by: Haotian Zhang <vulab@iscas.ac.cn>
Signed-off-by: Linus Walleij <linusw@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
de0711dbfb
commit
ae836bfac9
@@ -489,7 +489,8 @@ static int pcs_pinconf_get(struct pinctrl_dev *pctldev,
|
||||
struct pcs_device *pcs = pinctrl_dev_get_drvdata(pctldev);
|
||||
struct pcs_function *func;
|
||||
enum pin_config_param param;
|
||||
unsigned offset = 0, data = 0, i, j, ret;
|
||||
unsigned offset = 0, data = 0, i, j;
|
||||
int ret;
|
||||
|
||||
ret = pcs_get_function(pctldev, pin, &func);
|
||||
if (ret)
|
||||
@@ -553,9 +554,9 @@ static int pcs_pinconf_set(struct pinctrl_dev *pctldev,
|
||||
{
|
||||
struct pcs_device *pcs = pinctrl_dev_get_drvdata(pctldev);
|
||||
struct pcs_function *func;
|
||||
unsigned offset = 0, shift = 0, i, data, ret;
|
||||
unsigned offset = 0, shift = 0, i, data;
|
||||
u32 arg;
|
||||
int j;
|
||||
int j, ret;
|
||||
enum pin_config_param param;
|
||||
|
||||
ret = pcs_get_function(pctldev, pin, &func);
|
||||
|
||||
Reference in New Issue
Block a user