i2c: i2c-cros-ec-tunnel: Fix slave device enumeration
diff mbox series

Message ID 20191121090620.75569-1-akshu.agrawal@amd.com
State New
Headers show
Series
  • i2c: i2c-cros-ec-tunnel: Fix slave device enumeration
Related show

Commit Message

Akshu Agrawal Nov. 21, 2019, 9:06 a.m. UTC
During adding of the adapter the slave device registration
use to fail as the acpi companion field was not populated.

Signed-off-by: Akshu Agrawal <akshu.agrawal@amd.com>
---
 drivers/i2c/busses/i2c-cros-ec-tunnel.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Enric Balletbo i Serra Nov. 25, 2019, 3:32 p.m. UTC | #1
Hi Akshu,

On 21/11/19 10:06, Akshu Agrawal wrote:
> During adding of the adapter the slave device registration
> use to fail as the acpi companion field was not populated.
> 

I am wondering if this a fix that needs to picked on stable kernels? Which
chrome platform are you using?

Thanks,
 Enric

> Signed-off-by: Akshu Agrawal <akshu.agrawal@amd.com>
> ---
>  drivers/i2c/busses/i2c-cros-ec-tunnel.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/i2c/busses/i2c-cros-ec-tunnel.c b/drivers/i2c/busses/i2c-cros-ec-tunnel.c
> index c551aa96a2e3..aca8070393bd 100644
> --- a/drivers/i2c/busses/i2c-cros-ec-tunnel.c
> +++ b/drivers/i2c/busses/i2c-cros-ec-tunnel.c
> @@ -273,6 +273,7 @@ static int ec_i2c_probe(struct platform_device *pdev)
>  	bus->adap.dev.parent = &pdev->dev;
>  	bus->adap.dev.of_node = np;
>  	bus->adap.retries = I2C_MAX_RETRIES;
> +	ACPI_COMPANION_SET(&bus->adap.dev, ACPI_COMPANION(&pdev->dev));
>  
>  	err = i2c_add_adapter(&bus->adap);
>  	if (err)
>
Raul E Rangel Nov. 25, 2019, 6:08 p.m. UTC | #2
On Mon, Nov 25, 2019 at 8:32 AM Enric Balletbo i Serra
<enric.balletbo@collabora.com> wrote:
>
> Hi Akshu,
>
> On 21/11/19 10:06, Akshu Agrawal wrote:
> > During adding of the adapter the slave device registration
> > use to fail as the acpi companion field was not populated.
> >
>
> I am wondering if this a fix that needs to picked on stable kernels? Which
> chrome platform are you using?
>
It's a fixup of https://lore.kernel.org/patchwork/patch/1151436/ so
unless that patch has been ported to stable kernels, I wouldn't worry
about it.
Raul E Rangel Nov. 25, 2019, 6:09 p.m. UTC | #3
On Thu, Nov 21, 2019 at 2:06 AM Akshu Agrawal <akshu.agrawal@amd.com> wrote:
>
> During adding of the adapter the slave device registration
> use to fail as the acpi companion field was not populated.
>
> Signed-off-by: Akshu Agrawal <akshu.agrawal@amd.com>
> ---
>  drivers/i2c/busses/i2c-cros-ec-tunnel.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/drivers/i2c/busses/i2c-cros-ec-tunnel.c b/drivers/i2c/busses/i2c-cros-ec-tunnel.c
> index c551aa96a2e3..aca8070393bd 100644
> --- a/drivers/i2c/busses/i2c-cros-ec-tunnel.c
> +++ b/drivers/i2c/busses/i2c-cros-ec-tunnel.c
> @@ -273,6 +273,7 @@ static int ec_i2c_probe(struct platform_device *pdev)
>         bus->adap.dev.parent = &pdev->dev;
>         bus->adap.dev.of_node = np;
>         bus->adap.retries = I2C_MAX_RETRIES;
> +       ACPI_COMPANION_SET(&bus->adap.dev, ACPI_COMPANION(&pdev->dev));
>
>         err = i2c_add_adapter(&bus->adap);
>         if (err)
> --
> 2.17.1
>

Acked-by: Raul E Rangel <rrangel@chromium.org>
Enric Balletbo i Serra Nov. 26, 2019, 10:23 a.m. UTC | #4
Hi,

On 21/11/19 10:06, Akshu Agrawal wrote:
> During adding of the adapter the slave device registration
> use to fail as the acpi companion field was not populated.
> 
> Signed-off-by: Akshu Agrawal <akshu.agrawal@amd.com>

Looks good to me.

Reviewed-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>

> ---
>  drivers/i2c/busses/i2c-cros-ec-tunnel.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/i2c/busses/i2c-cros-ec-tunnel.c b/drivers/i2c/busses/i2c-cros-ec-tunnel.c
> index c551aa96a2e3..aca8070393bd 100644
> --- a/drivers/i2c/busses/i2c-cros-ec-tunnel.c
> +++ b/drivers/i2c/busses/i2c-cros-ec-tunnel.c
> @@ -273,6 +273,7 @@ static int ec_i2c_probe(struct platform_device *pdev)
>  	bus->adap.dev.parent = &pdev->dev;
>  	bus->adap.dev.of_node = np;
>  	bus->adap.retries = I2C_MAX_RETRIES;
> +	ACPI_COMPANION_SET(&bus->adap.dev, ACPI_COMPANION(&pdev->dev));
>  
>  	err = i2c_add_adapter(&bus->adap);
>  	if (err)
>

Patch
diff mbox series

diff --git a/drivers/i2c/busses/i2c-cros-ec-tunnel.c b/drivers/i2c/busses/i2c-cros-ec-tunnel.c
index c551aa96a2e3..aca8070393bd 100644
--- a/drivers/i2c/busses/i2c-cros-ec-tunnel.c
+++ b/drivers/i2c/busses/i2c-cros-ec-tunnel.c
@@ -273,6 +273,7 @@  static int ec_i2c_probe(struct platform_device *pdev)
 	bus->adap.dev.parent = &pdev->dev;
 	bus->adap.dev.of_node = np;
 	bus->adap.retries = I2C_MAX_RETRIES;
+	ACPI_COMPANION_SET(&bus->adap.dev, ACPI_COMPANION(&pdev->dev));
 
 	err = i2c_add_adapter(&bus->adap);
 	if (err)