diff mbox series

[RFC,v2,5/6] i2c: aspeed: Set the fwnode for the adap->dev

Message ID 20230530145601.2592-6-Jonathan.Cameron@huawei.com
State Superseded
Headers show
Series i2c: Enabling use of aspeed-i2c with ACPI | expand

Commit Message

Jonathan Cameron May 30, 2023, 2:56 p.m. UTC
This is needed for the bus matching used for ACPI based
i2c client registration.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
---
v2: Drop the separate setting of the of_node. (Thanks Andy)
---
 drivers/i2c/busses/i2c-aspeed.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Andy Shevchenko May 30, 2023, 7:51 p.m. UTC | #1
On Tue, May 30, 2023 at 5:58 PM Jonathan Cameron
<Jonathan.Cameron@huawei.com> wrote:
>
> This is needed for the bus matching used for ACPI based
> i2c client registration.

The right thing to do.
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>

> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> ---
> v2: Drop the separate setting of the of_node. (Thanks Andy)
> ---
>  drivers/i2c/busses/i2c-aspeed.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/i2c/busses/i2c-aspeed.c b/drivers/i2c/busses/i2c-aspeed.c
> index 353834d7ffd5..ae8e187f2233 100644
> --- a/drivers/i2c/busses/i2c-aspeed.c
> +++ b/drivers/i2c/busses/i2c-aspeed.c
> @@ -1017,7 +1017,6 @@ static int aspeed_i2c_probe_bus(struct platform_device *pdev)
>         bus->adap.retries = 0;
>         bus->adap.algo = &aspeed_i2c_algo;
>         bus->adap.dev.parent = &pdev->dev;
> -       bus->adap.dev.of_node = pdev->dev.of_node;
>         strscpy(bus->adap.name, pdev->name, sizeof(bus->adap.name));
>         i2c_set_adapdata(&bus->adap, bus);
>
> @@ -1043,6 +1042,8 @@ static int aspeed_i2c_probe_bus(struct platform_device *pdev)
>         if (ret < 0)
>                 return ret;
>
> +       device_set_node(&bus->adap.dev, dev_fwnode(&pdev->dev));
> +
>         ret = i2c_add_adapter(&bus->adap);
>         if (ret < 0)
>                 return ret;
> --
> 2.39.2
>
diff mbox series

Patch

diff --git a/drivers/i2c/busses/i2c-aspeed.c b/drivers/i2c/busses/i2c-aspeed.c
index 353834d7ffd5..ae8e187f2233 100644
--- a/drivers/i2c/busses/i2c-aspeed.c
+++ b/drivers/i2c/busses/i2c-aspeed.c
@@ -1017,7 +1017,6 @@  static int aspeed_i2c_probe_bus(struct platform_device *pdev)
 	bus->adap.retries = 0;
 	bus->adap.algo = &aspeed_i2c_algo;
 	bus->adap.dev.parent = &pdev->dev;
-	bus->adap.dev.of_node = pdev->dev.of_node;
 	strscpy(bus->adap.name, pdev->name, sizeof(bus->adap.name));
 	i2c_set_adapdata(&bus->adap, bus);
 
@@ -1043,6 +1042,8 @@  static int aspeed_i2c_probe_bus(struct platform_device *pdev)
 	if (ret < 0)
 		return ret;
 
+	device_set_node(&bus->adap.dev, dev_fwnode(&pdev->dev));
+
 	ret = i2c_add_adapter(&bus->adap);
 	if (ret < 0)
 		return ret;