Hello,

On Wed, Sep 09, 2015 at 10:12:19AM +0800, Gao Pan wrote:
>  static irqreturn_t i2c_imx_isr(int irq, void *dev_id)
> @@ -894,6 +893,10 @@ static int i2c_imx_xfer(struct i2c_adapter *adapter,
>  
>       dev_dbg(&i2c_imx->adapter.dev, "<%s>\n", __func__);
>  
> +     result = pm_runtime_get_sync(i2c_imx->adapter.dev.parent);
> +     if (result < 0)
> +             goto out;
> +
>       /* Start I2C transfer */
>       result = i2c_imx_start(i2c_imx);
>       if (result)
> @@ -950,6 +953,10 @@ fail0:
>       /* Stop I2C transfer */
>       i2c_imx_stop(i2c_imx);
>  
> +out:
> +     pm_runtime_mark_last_busy(i2c_imx->adapter.dev.parent);
> +     pm_runtime_put_autosuspend(i2c_imx->adapter.dev.parent);
> +

I doubt that it's correct to call these two functions if
pm_runtime_get_sync failed. Shouldn't the out label be after the two
calls?

Other than that I assume you tested your patch with and without CONFIG_PM?

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
--
To unsubscribe from this list: send the line "unsubscribe linux-i2c" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to