Commit ff370257 authored by Nishanth Menon's avatar Nishanth Menon Committed by Wolfram Sang

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: default avatarNishanth Menon <nm@ti.com>
Reviewed-by: default avatarFelipe Balbi <balbi@ti.com>
Signed-off-by: default avatarWolfram Sang <wsa@the-dreams.de>
parent 1b5b2371
...@@ -636,7 +636,7 @@ omap_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg msgs[], int num) ...@@ -636,7 +636,7 @@ omap_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg msgs[], int num)
int r; int r;
r = pm_runtime_get_sync(dev->dev); r = pm_runtime_get_sync(dev->dev);
if (IS_ERR_VALUE(r)) if (r < 0)
goto out; goto out;
r = omap_i2c_wait_for_bb(dev); r = omap_i2c_wait_for_bb(dev);
...@@ -1155,7 +1155,7 @@ omap_i2c_probe(struct platform_device *pdev) ...@@ -1155,7 +1155,7 @@ omap_i2c_probe(struct platform_device *pdev)
pm_runtime_use_autosuspend(dev->dev); pm_runtime_use_autosuspend(dev->dev);
r = pm_runtime_get_sync(dev->dev); r = pm_runtime_get_sync(dev->dev);
if (IS_ERR_VALUE(r)) if (r < 0)
goto err_free_mem; goto err_free_mem;
/* /*
...@@ -1276,7 +1276,7 @@ static int omap_i2c_remove(struct platform_device *pdev) ...@@ -1276,7 +1276,7 @@ static int omap_i2c_remove(struct platform_device *pdev)
i2c_del_adapter(&dev->adapter); i2c_del_adapter(&dev->adapter);
ret = pm_runtime_get_sync(&pdev->dev); ret = pm_runtime_get_sync(&pdev->dev);
if (IS_ERR_VALUE(ret)) if (ret < 0)
return ret; return ret;
omap_i2c_write_reg(dev, OMAP_I2C_CON_REG, 0); omap_i2c_write_reg(dev, OMAP_I2C_CON_REG, 0);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment