fsi: Fix an IS_ERR() vs NULL check in occ_probe()
PATCH 1/1 fsi: Fix an IS_ERR() vs NULL check in occ_probe()
The platform_device_register_full() function returns error pointers, it never returns NULL.
Signed-off-by Jing Xiangfeng <[email protected]>
--- drivers/fsi/fsi-occ.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/fsi/fsi-occ.c +1 -1
@@ -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 ;
Signature · 1 line
2.17.1
Quoted 5 lines · Jing Xiangfeng
The
platform_device_register_full()function returns error pointers, it never returns NULL.Signed-off-by Jing Xiangfeng <[email protected]>
Thanks for the patch. I already have this change queued up for 5.10.
Quoted 20 lines
--- drivers/fsi/fsi-occ.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/fsi/fsi-occ.c +1
-2@@ -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 ; --2.17.1