Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com> writes:
> Use i2c_adapter_dev() where applicable in order to avoid direct
> dereferencing of struct device embedded within struct i2c_adapter.
>
> Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Reviewed-by: Gregory CLEMENT <gregory.clement@bootlin.com>
Thanks,
Gregory
> ---
> drivers/i2c/busses/i2c-mv64xxx.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/i2c/busses/i2c-mv64xxx.c b/drivers/i2c/busses/i2c-mv64xxx.c
> index 1acba628e16c3bd1dbf82c777162870cbe3815ef..7892793d2a1cabf3376efcec1d031c3d764f7731 100644
> --- a/drivers/i2c/busses/i2c-mv64xxx.c
> +++ b/drivers/i2c/busses/i2c-mv64xxx.c
> @@ -747,7 +747,7 @@ mv64xxx_i2c_xfer_core(struct i2c_adapter *adap, struct i2c_msg msgs[], int num)
> struct mv64xxx_i2c_data *drv_data = i2c_get_adapdata(adap);
> int rc, ret = num;
>
> - rc = pm_runtime_resume_and_get(&adap->dev);
> + rc = pm_runtime_resume_and_get(i2c_adapter_dev(adap));
> if (rc)
> return rc;
>
> @@ -766,7 +766,7 @@ mv64xxx_i2c_xfer_core(struct i2c_adapter *adap, struct i2c_msg msgs[], int num)
> drv_data->num_msgs = 0;
> drv_data->msgs = NULL;
>
> - pm_runtime_put_autosuspend(&adap->dev);
> + pm_runtime_put_autosuspend(i2c_adapter_dev(adap));
>
> return ret;
> }
>
> --
> 2.47.3
>
--
Grégory CLEMENT, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com