summaryrefslogtreecommitdiffstats
path: root/drivers/fsi
diff options
context:
space:
mode:
authorXu Wang <vulab@iscas.ac.cn>2020-07-13 05:33:13 +0200
committerJoel Stanley <joel@jms.id.au>2020-09-10 04:52:47 +0200
commit3c3c484850bcb4b28f2377e3d641a32c42af949c (patch)
tree528756e938f7a7ab43f412a65a25d9dd52e583ba /drivers/fsi
parentfsi: aspeed: Enable 23-bit addressing (diff)
downloadlinux-3c3c484850bcb4b28f2377e3d641a32c42af949c.tar.xz
linux-3c3c484850bcb4b28f2377e3d641a32c42af949c.zip
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>
Diffstat (limited to 'drivers/fsi')
-rw-r--r--drivers/fsi/fsi-occ.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/fsi/fsi-occ.c b/drivers/fsi/fsi-occ.c
index 7da9c81759ac..9eeb856c8905 100644
--- a/drivers/fsi/fsi-occ.c
+++ b/drivers/fsi/fsi-occ.c
@@ -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;