diff options
author | Nishanth Menon <nm@ti.com> | 2014-03-27 12:18:33 -0400 |
---|---|---|
committer | Wolfram Sang <wsa@the-dreams.de> | 2014-03-27 13:53:26 -0400 |
commit | ff370257ed0bba6e98a9538fefa402a4696f9857 (patch) | |
tree | 62893c01d2362123618efb029abfc5d463b23aa1 /drivers/i2c | |
parent | 1b5b23718b8460b1627d3aeb4aa8ab04170e53f7 (diff) |
i2c: omap: fix usage of IS_ERR_VALUE with pm_runtime_get_sync
we use IS_ERR_VALUE to check for error values of pm_runtime_get_sync,
when the value can only be < 0 in the case of err. Replace the
check with a simpler < 0 check.
This fixes the coccicheck warnings:
linux-2.6/drivers/i2c/busses/i2c-omap.c:1157:5-24:
pm_runtime_get_sync returns < 0 as error. Unecessary IS_ERR_VALUE at
line 1158
linux-2.6/drivers/i2c/busses/i2c-omap.c:1278:7-26:
pm_runtime_get_sync returns < 0 as error. Unecessary IS_ERR_VALUE at
line 1279
drivers/i2c/busses/i2c-omap.c:638:5-24:
pm_runtime_get_sync returns < 0 as error. Unecessary IS_ERR_VALUE at
line 639
Signed-off-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Diffstat (limited to 'drivers/i2c')
-rw-r--r-- | drivers/i2c/busses/i2c-omap.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/i2c/busses/i2c-omap.c b/drivers/i2c/busses/i2c-omap.c index 8e2900412b04..85f8eac9ba18 100644 --- a/drivers/i2c/busses/i2c-omap.c +++ b/drivers/i2c/busses/i2c-omap.c | |||
@@ -636,7 +636,7 @@ omap_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg msgs[], int num) | |||
636 | int r; | 636 | int r; |
637 | 637 | ||
638 | r = pm_runtime_get_sync(dev->dev); | 638 | r = pm_runtime_get_sync(dev->dev); |
639 | if (IS_ERR_VALUE(r)) | 639 | if (r < 0) |
640 | goto out; | 640 | goto out; |
641 | 641 | ||
642 | r = omap_i2c_wait_for_bb(dev); | 642 | r = omap_i2c_wait_for_bb(dev); |
@@ -1155,7 +1155,7 @@ omap_i2c_probe(struct platform_device *pdev) | |||
1155 | pm_runtime_use_autosuspend(dev->dev); | 1155 | pm_runtime_use_autosuspend(dev->dev); |
1156 | 1156 | ||
1157 | r = pm_runtime_get_sync(dev->dev); | 1157 | r = pm_runtime_get_sync(dev->dev); |
1158 | if (IS_ERR_VALUE(r)) | 1158 | if (r < 0) |
1159 | goto err_free_mem; | 1159 | goto err_free_mem; |
1160 | 1160 | ||
1161 | /* | 1161 | /* |
@@ -1276,7 +1276,7 @@ static int omap_i2c_remove(struct platform_device *pdev) | |||
1276 | 1276 | ||
1277 | i2c_del_adapter(&dev->adapter); | 1277 | i2c_del_adapter(&dev->adapter); |
1278 | ret = pm_runtime_get_sync(&pdev->dev); | 1278 | ret = pm_runtime_get_sync(&pdev->dev); |
1279 | if (IS_ERR_VALUE(ret)) | 1279 | if (ret < 0) |
1280 | return ret; | 1280 | return ret; |
1281 | 1281 | ||
1282 | omap_i2c_write_reg(dev, OMAP_I2C_CON_REG, 0); | 1282 | omap_i2c_write_reg(dev, OMAP_I2C_CON_REG, 0); |