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>
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;
}
}