Commit e5840c78f3c9e3d950363e4305b65183f2998a73

Authored by Fengguang Wu
Committed by Guenter Roeck
1 parent 31ab1ad70b

hwmon: (max6642 fix coccinelle warnings

drivers/hwmon/max6642.c:299:1-3: WARNING: PTR_RET can be used

 Use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) + PTR_ERR

Generated by: coccinelle/api/ptr_ret.cocci

CC: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>

Showing 1 changed file with 1 additions and 4 deletions Side-by-side Diff

drivers/hwmon/max6642.c
... ... @@ -296,10 +296,7 @@
296 296 hwmon_dev = devm_hwmon_device_register_with_groups(&client->dev,
297 297 client->name, data,
298 298 max6642_groups);
299   - if (IS_ERR(hwmon_dev))
300   - return PTR_ERR(hwmon_dev);
301   -
302   - return 0;
  299 + return PTR_ERR_OR_ZERO(hwmon_dev);
303 300 }
304 301  
305 302 /*