[PATCH 07/12] i2c: st: set device parent and of_node through the adapter struct

Patrice CHOTARD patrice.chotard at foss.st.com
Sun Jan 4 23:26:02 PST 2026



On 12/23/25 11:04, Bartosz Golaszewski wrote:
> Configure the parent device and the OF-node using dedicated fields in
> struct i2c_adapter and avoid dereferencing the internal struct device.
> 
> Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski at oss.qualcomm.com>
> ---
>  drivers/i2c/busses/i2c-st.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/i2c/busses/i2c-st.c b/drivers/i2c/busses/i2c-st.c
> index 97d70e66722706f242cd97153387c3a865abc12d..b50be2c39eaa4b9b95a71b038a4d63f3c5fd7c4b 100644
> --- a/drivers/i2c/busses/i2c-st.c
> +++ b/drivers/i2c/busses/i2c-st.c
> @@ -849,8 +849,8 @@ static int st_i2c_probe(struct platform_device *pdev)
>  	adap->retries = 0;
>  	adap->algo = &st_i2c_algo;
>  	adap->bus_recovery_info = &st_i2c_recovery_info;
> -	adap->dev.parent = &pdev->dev;
> -	adap->dev.of_node = pdev->dev.of_node;
> +	adap->parent = &pdev->dev;
> +	adap->of_node = pdev->dev.of_node;
>  
>  	init_completion(&i2c_dev->complete);
>  
> 
Reviewed-by: Patrice Chotard <patrice.chotard at foss.st.com>

Thanks
Patrice



More information about the linux-arm-kernel mailing list