mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-24 04:34:08 +08:00
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: Xu Wang <vulab@iscas.ac.cn> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Joel Stanley <joel@jms.id.au>
This commit is contained in:
parent
6e0ef7d2ce
commit
3c3c484850
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user