Commit 3c3c4848 authored by Xu Wang's avatar Xu Wang Committed by Joel Stanley

fsi: fsi-occ: fix return value check in occ_probe()

In case of error, the function platform_device_register_full()
returns ERR_PTR() and never returns NULL. The NULL test in the
return value check should be replaced with IS_ERR().
Signed-off-by: default avatarXu Wang <vulab@iscas.ac.cn>
Reviewed-by: default avatarGuenter Roeck <linux@roeck-us.net>
Signed-off-by: default avatarJoel Stanley <joel@jms.id.au>
parent 6e0ef7d2
......@@ -555,7 +555,7 @@ static int occ_probe(struct platform_device *pdev)
hwmon_dev_info.id = occ->idx;
hwmon_dev = platform_device_register_full(&hwmon_dev_info);
if (!hwmon_dev)
if (IS_ERR(hwmon_dev))
dev_warn(dev, "failed to create hwmon device\n");
return 0;
......
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