Commit f70d9a24 authored by Wei Yongjun's avatar Wei Yongjun Committed by Ulf Hansson

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: default avatarWei Yongjun <weiyongjun1@huawei.com>
Reviewed-by: default avatarAndrew Jeffery <andrew@aj.id.au>
Signed-off-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
parent f47fdb85
......@@ -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;
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment