2021-08-19 00:51:17

by Jie Deng

[permalink] [raw]
Subject: [PATCH] i2c: virtio: Fix the compiler warning when CONFIG_ACPI is not set

Fix the compiler warning "drivers/i2c/busses/i2c-virtio.c:208:17:
warning: unused variable 'pdev' [-Wunused-variable]" when CONFIG_ACPI
is not set.

Fixes: 8fb12751ac78 ("i2c: virtio: add a virtio i2c frontend driver")
Signed-off-by: Jie Deng <[email protected]>
---
drivers/i2c/busses/i2c-virtio.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/i2c/busses/i2c-virtio.c b/drivers/i2c/busses/i2c-virtio.c
index d3e60d9..964c601 100644
--- a/drivers/i2c/busses/i2c-virtio.c
+++ b/drivers/i2c/busses/i2c-virtio.c
@@ -205,7 +205,6 @@ static const struct i2c_adapter_quirks virtio_i2c_quirks = {

static int virtio_i2c_probe(struct virtio_device *vdev)
{
- struct device *pdev = vdev->dev.parent;
struct virtio_i2c *vi;
int ret;

@@ -234,7 +233,7 @@ static int virtio_i2c_probe(struct virtio_device *vdev)
* Setup ACPI node for controlled devices which will be probed through
* ACPI.
*/
- ACPI_COMPANION_SET(&vi->adap.dev, ACPI_COMPANION(pdev));
+ ACPI_COMPANION_SET(&vi->adap.dev, ACPI_COMPANION(vdev->dev.parent));

ret = i2c_add_adapter(&vi->adap);
if (ret)
--
2.7.4


2021-08-19 03:07:58

by Stephen Rothwell

[permalink] [raw]
Subject: Re: [PATCH] i2c: virtio: Fix the compiler warning when CONFIG_ACPI is not set

Hi Jie,

On Thu, 19 Aug 2021 08:48:41 +0800 Jie Deng <[email protected]> wrote:
>
> Fix the compiler warning "drivers/i2c/busses/i2c-virtio.c:208:17:
> warning: unused variable 'pdev' [-Wunused-variable]" when CONFIG_ACPI
> is not set.
>
> Fixes: 8fb12751ac78 ("i2c: virtio: add a virtio i2c frontend driver")

Reported-by: Stephen Rothwell <[email protected]>

> Signed-off-by: Jie Deng <[email protected]>
> ---
> drivers/i2c/busses/i2c-virtio.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/i2c/busses/i2c-virtio.c b/drivers/i2c/busses/i2c-virtio.c
> index d3e60d9..964c601 100644
> --- a/drivers/i2c/busses/i2c-virtio.c
> +++ b/drivers/i2c/busses/i2c-virtio.c
> @@ -205,7 +205,6 @@ static const struct i2c_adapter_quirks virtio_i2c_quirks = {
>
> static int virtio_i2c_probe(struct virtio_device *vdev)
> {
> - struct device *pdev = vdev->dev.parent;
> struct virtio_i2c *vi;
> int ret;
>
> @@ -234,7 +233,7 @@ static int virtio_i2c_probe(struct virtio_device *vdev)
> * Setup ACPI node for controlled devices which will be probed through
> * ACPI.
> */
> - ACPI_COMPANION_SET(&vi->adap.dev, ACPI_COMPANION(pdev));
> + ACPI_COMPANION_SET(&vi->adap.dev, ACPI_COMPANION(vdev->dev.parent));
>
> ret = i2c_add_adapter(&vi->adap);
> if (ret)

Looks good to me.

--
Cheers,
Stephen Rothwell


Attachments:
(No filename) (499.00 B)
OpenPGP digital signature

2021-08-19 03:52:13

by Viresh Kumar

[permalink] [raw]
Subject: Re: [PATCH] i2c: virtio: Fix the compiler warning when CONFIG_ACPI is not set

On 19-08-21, 08:48, Jie Deng wrote:
> Fix the compiler warning "drivers/i2c/busses/i2c-virtio.c:208:17:
> warning: unused variable 'pdev' [-Wunused-variable]" when CONFIG_ACPI
> is not set.
>
> Fixes: 8fb12751ac78 ("i2c: virtio: add a virtio i2c frontend driver")
> Signed-off-by: Jie Deng <[email protected]>
> ---
> drivers/i2c/busses/i2c-virtio.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/i2c/busses/i2c-virtio.c b/drivers/i2c/busses/i2c-virtio.c
> index d3e60d9..964c601 100644
> --- a/drivers/i2c/busses/i2c-virtio.c
> +++ b/drivers/i2c/busses/i2c-virtio.c
> @@ -205,7 +205,6 @@ static const struct i2c_adapter_quirks virtio_i2c_quirks = {
>
> static int virtio_i2c_probe(struct virtio_device *vdev)
> {
> - struct device *pdev = vdev->dev.parent;
> struct virtio_i2c *vi;
> int ret;
>
> @@ -234,7 +233,7 @@ static int virtio_i2c_probe(struct virtio_device *vdev)
> * Setup ACPI node for controlled devices which will be probed through
> * ACPI.
> */
> - ACPI_COMPANION_SET(&vi->adap.dev, ACPI_COMPANION(pdev));
> + ACPI_COMPANION_SET(&vi->adap.dev, ACPI_COMPANION(vdev->dev.parent));
>
> ret = i2c_add_adapter(&vi->adap);
> if (ret)

Acked-by: Viresh Kumar <[email protected]>

--
viresh

2021-08-19 17:26:36

by Wolfram Sang

[permalink] [raw]
Subject: Re: [PATCH] i2c: virtio: Fix the compiler warning when CONFIG_ACPI is not set

On Thu, Aug 19, 2021 at 08:48:41AM +0800, Jie Deng wrote:
> Fix the compiler warning "drivers/i2c/busses/i2c-virtio.c:208:17:
> warning: unused variable 'pdev' [-Wunused-variable]" when CONFIG_ACPI
> is not set.
>
> Fixes: 8fb12751ac78 ("i2c: virtio: add a virtio i2c frontend driver")
> Signed-off-by: Jie Deng <[email protected]>

Applied to for-next, thanks! Since I need to rebase for-mergewindow
anyhow, I might just squash it into the main patch.


Attachments:
(No filename) (465.00 B)
signature.asc (849.00 B)
Download all attachments