소스 검색

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>
Wei Yongjun 11 년 전
부모
커밋
4f51b91335
1개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  1. 2 2
      drivers/gpio/gpio-xgene.c

+ 2 - 2
drivers/gpio/gpio-xgene.c

@@ -182,8 +182,8 @@ static int xgene_gpio_probe(struct platform_device *pdev)
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	gpio->base = devm_ioremap_nocache(&pdev->dev, res->start,
 							resource_size(res));
-	if (IS_ERR(gpio->base)) {
-		err = PTR_ERR(gpio->base);
+	if (!gpio->base) {
+		err = -ENOMEM;
 		goto err;
 	}