[PATCH 3/7] i2c: gpio: use i2c_adapter_set_node()

Bartosz Golaszewski posted 7 patches 1 month, 2 weeks ago
[PATCH 3/7] i2c: gpio: 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-gpio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/i2c/busses/i2c-gpio.c b/drivers/i2c/busses/i2c-gpio.c
index f4355b17bfbf15c402e71096ccbb99f5a35bb479..4984736969e1bf2d11620772214cb13ceb411b6a 100644
--- a/drivers/i2c/busses/i2c-gpio.c
+++ b/drivers/i2c/busses/i2c-gpio.c
@@ -426,7 +426,7 @@ static int i2c_gpio_probe(struct platform_device *pdev)
 	adap->algo_data = bit_data;
 	adap->class = I2C_CLASS_HWMON;
 	adap->dev.parent = dev;
-	device_set_node(&adap->dev, fwnode);
+	i2c_adapter_set_node(adap, fwnode);
 
 	adap->nr = pdev->id;
 	ret = i2c_bit_add_numbered_bus(adap);

-- 
2.47.3
Re: [PATCH 3/7] i2c: gpio: use i2c_adapter_set_node()
Posted by Wolfram Sang 3 weeks, 2 days ago
On Tue, Dec 23, 2025 at 11:06:50AM +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>

Applying this patch fails for me. What is your base? I don't have the
commit referenced in the first patch series. I tried current top-of-tree
and current -next.

Re: [PATCH 3/7] i2c: gpio: use i2c_adapter_set_node()
Posted by Bartosz Golaszewski 3 weeks, 1 day ago
On Thu, 15 Jan 2026 19:28:51 +0100, Wolfram Sang
<wsa+renesas@sang-engineering.com> said:
> On Tue, Dec 23, 2025 at 11:06:50AM +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>
>
> Applying this patch fails for me. What is your base? I don't have the
> commit referenced in the first patch series. I tried current top-of-tree
> and current -next.
>

It's v6.19-rc2:

$ git show 9448598b22c50c8a5bb77a9103e2d49f134c9578
commit 9448598b22c50c8a5bb77a9103e2d49f134c9578 (tag: v6.19-rc2)
Author: Linus Torvalds <torvalds@linux-foundation.org>
Date:   Sun Dec 21 15:52:04 2025 -0800

    Linux 6.19-rc2

Bart