[PATCHv9 07/10] I2C: OMAP: Handle error check for pm runtime
From: Kevin Hilman <hidden>
Date: 2012-05-25 22:06:04
Also in:
linux-i2c, linux-omap
From: Kevin Hilman <hidden>
Date: 2012-05-25 22:06:04
Also in:
linux-i2c, linux-omap
Shubhrajyoti D [off-list ref] writes:
If PM runtime get_sync fails return with the error so that no further reads/writes goes through the interface. This will avoid possible abort. Add a error message in case of failure with the cause of the failure. Signed-off-by: Shubhrajyoti D <redacted> --- drivers/i2c/busses/i2c-omap.c | 14 +++++++++++--- 1 files changed, 11 insertions(+), 3 deletions(-)diff --git a/drivers/i2c/busses/i2c-omap.c b/drivers/i2c/busses/i2c-omap.c index 44e8cfa..a72874e 100644 --- a/drivers/i2c/busses/i2c-omap.c +++ b/drivers/i2c/busses/i2c-omap.c@@ -585,7 +585,9 @@ omap_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg msgs[], int num) int i; int r; - pm_runtime_get_sync(dev->dev); + r = pm_runtime_get_sync(dev->dev); + if (r < 0) + return r;
nit: please use IS_ERR_VALUE() Kevin