LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH] i2c: virtio: Fix the compiler warning when CONFIG_ACPI is not set
@ 2021-08-19  0:48 Jie Deng
  2021-08-19  3:06 ` Stephen Rothwell
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Jie Deng @ 2021-08-19  0:48 UTC (permalink / raw)
  To: linux-i2c, virtualization, linux-kernel
  Cc: wsa, jie.deng, viresh.kumar, sfr, conghui.chen

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 <jie.deng@intel.com>
---
 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


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] i2c: virtio: Fix the compiler warning when CONFIG_ACPI is not set
  2021-08-19  0:48 [PATCH] i2c: virtio: Fix the compiler warning when CONFIG_ACPI is not set Jie Deng
@ 2021-08-19  3:06 ` Stephen Rothwell
  2021-08-19  3:49 ` Viresh Kumar
  2021-08-19 17:24 ` Wolfram Sang
  2 siblings, 0 replies; 4+ messages in thread
From: Stephen Rothwell @ 2021-08-19  3:06 UTC (permalink / raw)
  To: Jie Deng
  Cc: linux-i2c, virtualization, linux-kernel, wsa, viresh.kumar, conghui.chen

[-- Attachment #1: Type: text/plain, Size: 1404 bytes --]

Hi Jie,

On Thu, 19 Aug 2021 08:48:41 +0800 Jie Deng <jie.deng@intel.com> 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 <sfr@canb.auug.org.au>

> Signed-off-by: Jie Deng <jie.deng@intel.com>
> ---
>  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

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] i2c: virtio: Fix the compiler warning when CONFIG_ACPI is not set
  2021-08-19  0:48 [PATCH] i2c: virtio: Fix the compiler warning when CONFIG_ACPI is not set Jie Deng
  2021-08-19  3:06 ` Stephen Rothwell
@ 2021-08-19  3:49 ` Viresh Kumar
  2021-08-19 17:24 ` Wolfram Sang
  2 siblings, 0 replies; 4+ messages in thread
From: Viresh Kumar @ 2021-08-19  3:49 UTC (permalink / raw)
  To: Jie Deng; +Cc: linux-i2c, virtualization, linux-kernel, wsa, sfr, conghui.chen

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 <jie.deng@intel.com>
> ---
>  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 <viresh.kumar@linaro.org>

-- 
viresh

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] i2c: virtio: Fix the compiler warning when CONFIG_ACPI is not set
  2021-08-19  0:48 [PATCH] i2c: virtio: Fix the compiler warning when CONFIG_ACPI is not set Jie Deng
  2021-08-19  3:06 ` Stephen Rothwell
  2021-08-19  3:49 ` Viresh Kumar
@ 2021-08-19 17:24 ` Wolfram Sang
  2 siblings, 0 replies; 4+ messages in thread
From: Wolfram Sang @ 2021-08-19 17:24 UTC (permalink / raw)
  To: Jie Deng
  Cc: linux-i2c, virtualization, linux-kernel, viresh.kumar, sfr, conghui.chen

[-- Attachment #1: Type: text/plain, Size: 465 bytes --]

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 <jie.deng@intel.com>

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

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-08-19 17:24 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-19  0:48 [PATCH] i2c: virtio: Fix the compiler warning when CONFIG_ACPI is not set Jie Deng
2021-08-19  3:06 ` Stephen Rothwell
2021-08-19  3:49 ` Viresh Kumar
2021-08-19 17:24 ` Wolfram Sang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).