Commit 650a2c02b5a0eaf46209bf505f95739366119bc8
Committed by
Guenter Roeck
1 parent
2a253c4789
Exists in
smarc-imx_3.14.28_1.0.0_ga
and in
1 other branch
hwmon: (jc42) fix coccinelle warnings
drivers/hwmon/jc42.c:521: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/jc42.c
... | ... | @@ -518,10 +518,7 @@ |
518 | 518 | hwmon_dev = devm_hwmon_device_register_with_groups(dev, client->name, |
519 | 519 | data, |
520 | 520 | jc42_groups); |
521 | - if (IS_ERR(hwmon_dev)) | |
522 | - return PTR_ERR(hwmon_dev); | |
523 | - | |
524 | - return 0; | |
521 | + return PTR_ERR_OR_ZERO(hwmon_dev); | |
525 | 522 | } |
526 | 523 | |
527 | 524 | static int jc42_remove(struct i2c_client *client) |