Skip to content

Commit

Permalink
hwmon: (lm95234) fix coccinelle warnings
Browse files Browse the repository at this point in the history
drivers/hwmon/lm95234.c:704: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 <[email protected]>
Signed-off-by: Fengguang Wu <[email protected]>
Signed-off-by: Guenter Roeck <[email protected]>
  • Loading branch information
Fengguang Wu authored and groeck committed Oct 18, 2013
1 parent 4109a71 commit 3ea85ba
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions drivers/hwmon/lm95234.c
Original file line number Diff line number Diff line change
Expand Up @@ -701,10 +701,7 @@ static int lm95234_probe(struct i2c_client *client,
hwmon_dev = devm_hwmon_device_register_with_groups(dev, client->name,
data,
lm95234_groups);
if (IS_ERR(hwmon_dev))
return PTR_ERR(hwmon_dev);

return 0;
return PTR_ERR_OR_ZERO(hwmon_dev);
}

/* Driver data (common to all clients) */
Expand Down

0 comments on commit 3ea85ba

Please sign in to comment.