hwmon: (jc42) fix coccinelle warnings
authorFengguang Wu <fengguang.wu@intel.com>
Wed, 18 Sep 2013 03:54:24 +0000 (20:54 -0700)
committerGuenter Roeck <linux@roeck-us.net>
Fri, 18 Oct 2013 16:12:01 +0000 (09:12 -0700)
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>
drivers/hwmon/jc42.c

index f362cea..6013611 100644 (file)
@@ -518,10 +518,7 @@ static int jc42_probe(struct i2c_client *client, const struct i2c_device_id *id)
        hwmon_dev = devm_hwmon_device_register_with_groups(dev, client->name,
                                                           data,
                                                           jc42_groups);
-       if (IS_ERR(hwmon_dev))
-               return PTR_ERR(hwmon_dev);
-
-       return 0;
+       return PTR_ERR_OR_ZERO(hwmon_dev);
 }
 
 static int jc42_remove(struct i2c_client *client)