]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
mmc: jz4740: Use PTR_ERR_OR_ZERO in jz4740_mmc_request_gpios()
authorYueHaibing <yuehaibing@huawei.com>
Sat, 1 Dec 2018 01:45:46 +0000 (01:45 +0000)
committerUlf Hansson <ulf.hansson@linaro.org>
Mon, 17 Dec 2018 07:26:24 +0000 (08:26 +0100)
Use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) + PTR_ERR

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Acked-by: Joey Pabalinas <joeypabalinas@gmail.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
drivers/mmc/host/jz4740_mmc.c

index e82b0e14822a707dd9e7a886182664dffd09f2d3..33215d66afa2ee764b6c28e84e5daf2b11be9c04 100644 (file)
@@ -965,10 +965,7 @@ static int jz4740_mmc_request_gpios(struct jz4740_mmc_host *host,
 
        host->power = devm_gpiod_get_optional(&pdev->dev, "power",
                                              GPIOD_OUT_HIGH);
-       if (IS_ERR(host->power))
-               return PTR_ERR(host->power);
-
-       return 0;
+       return PTR_ERR_OR_ZERO(host->power);
 }
 
 static const struct of_device_id jz4740_mmc_of_match[] = {