[PATCH v2 07/12] i2c: st: set device parent and of_node through the adapter struct
Bartosz Golaszewski
bartosz.golaszewski at oss.qualcomm.com
Mon Feb 23 01:05:53 PST 2026
Configure the parent device and the OF-node using dedicated fields in
struct i2c_adapter and avoid dereferencing the internal struct device.
Reviewed-by: Patrice Chotard <patrice.chotard at foss.st.com>
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 751ea421caaf388bc2337026e0860707823546d7..88ee5dfb55e469b64537694224a0fe39008a80c2 100644
--- a/drivers/i2c/busses/i2c-st.c
+++ b/drivers/i2c/busses/i2c-st.c
@@ -850,8 +850,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);
--
2.47.3
More information about the linux-arm-kernel
mailing list