[PATCH 4/7] i2c: ljca: use i2c_adapter_set_node()

Bartosz Golaszewski posted 7 patches 1 month, 2 weeks ago
[PATCH 4/7] i2c: ljca: use i2c_adapter_set_node()
Posted by Bartosz Golaszewski 1 month, 2 weeks ago
Use the dedicated wrapper for setting the fwnode of the i2c_adapter.
This allows us to hide the dereferencing of the embedded struct device.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
---
 drivers/i2c/busses/i2c-ljca.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/i2c/busses/i2c-ljca.c b/drivers/i2c/busses/i2c-ljca.c
index 93274f0c2d72166bf017f65af797f418743b6a57..fb45019b1a0c583f19bce3523983a79d632da3da 100644
--- a/drivers/i2c/busses/i2c-ljca.c
+++ b/drivers/i2c/busses/i2c-ljca.c
@@ -294,7 +294,7 @@ static int ljca_i2c_probe(struct auxiliary_device *auxdev,
 		 dev_name(&auxdev->dev), dev_name(auxdev->dev.parent),
 		 ljca_i2c->i2c_info->id);
 
-	device_set_node(&ljca_i2c->adap.dev, dev_fwnode(&auxdev->dev));
+	i2c_adapter_set_node(&ljca_i2c->adap, dev_fwnode(&auxdev->dev));
 
 	i2c_set_adapdata(&ljca_i2c->adap, ljca_i2c);
 	auxiliary_set_drvdata(auxdev, ljca_i2c);

-- 
2.47.3
Re: [PATCH 4/7] i2c: ljca: use i2c_adapter_set_node()
Posted by Sakari Ailus 1 month, 1 week ago
On Tue, Dec 23, 2025 at 11:06:51AM +0100, Bartosz Golaszewski wrote:
> Use the dedicated wrapper for setting the fwnode of the i2c_adapter.
> This allows us to hide the dereferencing of the embedded struct device.
> 
> Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>

Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>

-- 
Sakari Ailus
RE: [PATCH 4/7] i2c: ljca: use i2c_adapter_set_node()
Posted by Zhang, Lixu 1 month, 1 week ago
>-----Original Message-----
>From: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
>Sent: Tuesday, December 23, 2025 6:07 PM
>To: Wolfram Sang <wsa+renesas@sang-engineering.com>; Mika Westerberg
><mika.westerberg@linux.intel.com>; Andy Shevchenko
><andriy.shevchenko@linux.intel.com>; Jan Dabros <jsd@semihalf.com>; Andi
>Shyti <andi.shyti@kernel.org>; Zhang, Lixu <lixu.zhang@intel.com>; Sakari
>Ailus <sakari.ailus@linux.intel.com>; Binbin Zhou <zhoubinbin@loongson.cn>;
>Fabrizio Castro <fabrizio.castro.jz@renesas.com>; Cepeda Lopez, Israel A
><israel.a.cepeda.lopez@intel.com>; Hans de Goede <hansg@kernel.org>
>Cc: Bartosz Golaszewski <brgl@kernel.org>; linux-i2c@vger.kernel.org; linux-
>kernel@vger.kernel.org; linux-renesas-soc@vger.kernel.org; Bartosz
>Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
>Subject: [PATCH 4/7] i2c: ljca: use i2c_adapter_set_node()
>
>Use the dedicated wrapper for setting the fwnode of the i2c_adapter.
>This allows us to hide the dereferencing of the embedded struct device.
>
>Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>

Reviewed-by: Zhang Lixu <lixu.zhang@intel.com>

Thanks,
Lixu

>---
> drivers/i2c/busses/i2c-ljca.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
>diff --git a/drivers/i2c/busses/i2c-ljca.c b/drivers/i2c/busses/i2c-ljca.c index
>93274f0c2d72166bf017f65af797f418743b6a57..fb45019b1a0c583f19bce3523
>983a79d632da3da 100644
>--- a/drivers/i2c/busses/i2c-ljca.c
>+++ b/drivers/i2c/busses/i2c-ljca.c
>@@ -294,7 +294,7 @@ static int ljca_i2c_probe(struct auxiliary_device
>*auxdev,
> 		 dev_name(&auxdev->dev), dev_name(auxdev->dev.parent),
> 		 ljca_i2c->i2c_info->id);
>
>-	device_set_node(&ljca_i2c->adap.dev, dev_fwnode(&auxdev->dev));
>+	i2c_adapter_set_node(&ljca_i2c->adap, dev_fwnode(&auxdev->dev));
>
> 	i2c_set_adapdata(&ljca_i2c->adap, ljca_i2c);
> 	auxiliary_set_drvdata(auxdev, ljca_i2c);
>
>--
>2.47.3