diff options
author | Wei Yongjun <yongjun_wei@trendmicro.com.cn> | 2013-06-28 07:30:40 -0400 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2013-06-28 10:01:49 -0400 |
commit | 5c75acdcae1be608b27414334d7e1febef7dbd99 (patch) | |
tree | 60cf056fd19728fccfe467710d8f42e0c9a9e396 /drivers/pinctrl/pinctrl-st.c | |
parent | 701016c0cba594d5dbd26652ed1e52b0fe2926fd (diff) |
pinctrl: st: fix return value check
In case of error, the function pinctrl_register() returns
NULL not ERR_PTR(). The IS_ERR() test in the return value
check should be replaced with NULL test.
The function syscon_regmap_lookup_by_phandle() returns ERR_PTR()
and never returns NULL. The NULL test in the return value check
should be replaced with IS_ERR().
Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Acked-by: Srinivas Kandagatla <srinivas.kandagatla@st.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Diffstat (limited to 'drivers/pinctrl/pinctrl-st.c')
-rw-r--r-- | drivers/pinctrl/pinctrl-st.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/pinctrl/pinctrl-st.c b/drivers/pinctrl/pinctrl-st.c index 7effedfd4761..de8c62664fa8 100644 --- a/drivers/pinctrl/pinctrl-st.c +++ b/drivers/pinctrl/pinctrl-st.c | |||
@@ -1299,9 +1299,9 @@ static int st_pctl_probe_dt(struct platform_device *pdev, | |||
1299 | return -ENOMEM; | 1299 | return -ENOMEM; |
1300 | 1300 | ||
1301 | info->regmap = syscon_regmap_lookup_by_phandle(np, "st,syscfg"); | 1301 | info->regmap = syscon_regmap_lookup_by_phandle(np, "st,syscfg"); |
1302 | if (!info->regmap) { | 1302 | if (IS_ERR(info->regmap)) { |
1303 | dev_err(info->dev, "No syscfg phandle specified\n"); | 1303 | dev_err(info->dev, "No syscfg phandle specified\n"); |
1304 | return -ENOMEM; | 1304 | return PTR_ERR(info->regmap); |
1305 | } | 1305 | } |
1306 | info->data = of_match_node(st_pctl_of_match, np)->data; | 1306 | info->data = of_match_node(st_pctl_of_match, np)->data; |
1307 | 1307 | ||
@@ -1376,9 +1376,9 @@ static int st_pctl_probe(struct platform_device *pdev) | |||
1376 | pctl_desc->name = dev_name(&pdev->dev); | 1376 | pctl_desc->name = dev_name(&pdev->dev); |
1377 | 1377 | ||
1378 | info->pctl = pinctrl_register(pctl_desc, &pdev->dev, info); | 1378 | info->pctl = pinctrl_register(pctl_desc, &pdev->dev, info); |
1379 | if (IS_ERR(info->pctl)) { | 1379 | if (!info->pctl) { |
1380 | dev_err(&pdev->dev, "Failed pinctrl registration\n"); | 1380 | dev_err(&pdev->dev, "Failed pinctrl registration\n"); |
1381 | return PTR_ERR(info->pctl); | 1381 | return -EINVAL; |
1382 | } | 1382 | } |
1383 | 1383 | ||
1384 | for (i = 0; i < info->nbanks; i++) | 1384 | for (i = 0; i < info->nbanks; i++) |