提交 03ee62f0 编写于 作者: D Dan Carpenter 提交者: Len Brown

thermal: spear13xx: checking for NULL instead of IS_ERR()

thermal_zone_device_register() never returns NULL, on error it returns and
ERR_PTR().
Signed-off-by: NDan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: NViresh Kumar <viresh.kumar@st.com>
Reviewed-by: NVincenzo Frascino <vincenzo.frascino@st.com>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLen Brown <len.brown@intel.com>
上级 de716e32
......@@ -149,9 +149,9 @@ static int spear_thermal_probe(struct platform_device *pdev)
spear_thermal = thermal_zone_device_register("spear_thermal", 0,
stdev, &ops, 0, 0, 0, 0);
if (!spear_thermal) {
if (IS_ERR(spear_thermal)) {
dev_err(&pdev->dev, "thermal zone device is NULL\n");
ret = -EINVAL;
ret = PTR_ERR(spear_thermal);
goto disable_clk;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册