summaryrefslogtreecommitdiffstats
path: root/drivers/mmc/host/sdhci-of-aspeed.c
diff options
context:
space:
mode:
authorWei Yongjun <weiyongjun1@huawei.com>2019-08-26 14:00:13 +0200
committerUlf Hansson <ulf.hansson@linaro.org>2019-09-11 15:58:39 +0200
commitf70d9a2440346d942f1f9dbda31da5a77510a05f (patch)
tree00e94d9a6d7a0e992d1e526e802ead8787f6ec9b /drivers/mmc/host/sdhci-of-aspeed.c
parentdt-bindings: mmc: sdhci-of-aspeed: Update example ranges property (diff)
downloadlinux-f70d9a2440346d942f1f9dbda31da5a77510a05f.tar.xz
linux-f70d9a2440346d942f1f9dbda31da5a77510a05f.zip
mmc: sdhci-of-aspeed: Fix return value check in aspeed_sdc_probe()
In case of error, the function of_platform_device_create() 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 <weiyongjun1@huawei.com> Reviewed-by: Andrew Jeffery <andrew@aj.id.au> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Diffstat (limited to 'drivers/mmc/host/sdhci-of-aspeed.c')
-rw-r--r--drivers/mmc/host/sdhci-of-aspeed.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/mmc/host/sdhci-of-aspeed.c b/drivers/mmc/host/sdhci-of-aspeed.c
index 8bb095ca2fa9..d5acb5afc50f 100644
--- a/drivers/mmc/host/sdhci-of-aspeed.c
+++ b/drivers/mmc/host/sdhci-of-aspeed.c
@@ -261,9 +261,9 @@ static int aspeed_sdc_probe(struct platform_device *pdev)
struct platform_device *cpdev;
cpdev = of_platform_device_create(child, NULL, &pdev->dev);
- if (IS_ERR(cpdev)) {
+ if (!cpdev) {
of_node_put(child);
- ret = PTR_ERR(cpdev);
+ ret = -ENODEV;
goto err_clk;
}
}