aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWei Yongjun <yongjun_wei@trendmicro.com.cn>2014-09-11 19:12:14 -0400
committerLinus Walleij <linus.walleij@linaro.org>2014-09-24 04:04:28 -0400
commit4f51b91335a63b2672a0f21fd13a684c8e35c4e8 (patch)
tree59f808456d03bc48d484022aa0df61380d4a45bc
parent43a8785aeedc3eb1ffce95d46a8e7ca3e0d591d8 (diff)
gpio: Fix return value check in xgene_gpio_probe()
In case of error, the function devm_ioremap_nocache() returns NULL pointer not ERR_PTR(). The IS_ERR() test in the return value check should be replaced with NULL test. Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn> Reviewed-by: Alexandre Courbot <acourbot@nvidia.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
-rw-r--r--drivers/gpio/gpio-xgene.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/gpio/gpio-xgene.c b/drivers/gpio/gpio-xgene.c
index f1944d496c3b..150e7f1c5ae8 100644
--- a/drivers/gpio/gpio-xgene.c
+++ b/drivers/gpio/gpio-xgene.c
@@ -182,8 +182,8 @@ static int xgene_gpio_probe(struct platform_device *pdev)
182 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 182 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
183 gpio->base = devm_ioremap_nocache(&pdev->dev, res->start, 183 gpio->base = devm_ioremap_nocache(&pdev->dev, res->start,
184 resource_size(res)); 184 resource_size(res));
185 if (IS_ERR(gpio->base)) { 185 if (!gpio->base) {
186 err = PTR_ERR(gpio->base); 186 err = -ENOMEM;
187 goto err; 187 goto err;
188 } 188 }
189 189