linux-staging.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
From: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: Wolfram Sang <wsa@kernel.org>,
	Hans de Goede <hdegoede@redhat.com>,
	linux-i2c@vger.kernel.org, linux-acpi@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-media@vger.kernel.org,
	linux-staging@lists.linux.dev,
	Mika Westerberg <mika.westerberg@linux.intel.com>,
	Mauro Carvalho Chehab <mchehab@kernel.org>,
	Sakari Ailus <sakari.ailus@linux.intel.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Subject: Re: [PATCH v1 2/6] staging: atomisp: Replace open-coded i2c_acpi_find_client_by_adev()
Date: Thu, 22 Jul 2021 10:57:44 +0200	[thread overview]
Message-ID: <20210722105744.4a94d58d@coco.lan> (raw)
In-Reply-To: <20210526124322.48915-2-andriy.shevchenko@linux.intel.com>

Hi Andy,

Em Wed, 26 May 2021 15:43:18 +0300
Andy Shevchenko <andriy.shevchenko@linux.intel.com> escreveu:

> gmin_i2c_dev_exists() is using open-coded variant of
> i2c_acpi_find_client_by_adev(). Replace it with a corresponding call.
> 
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

At least on the top of v5.14-rc1, this patch causes a compilation
issue:

	drivers/staging/media/atomisp/pci/atomisp_gmin_platform.c: In function ‘gmin_i2c_dev_exists’:
	drivers/staging/media/atomisp/pci/atomisp_gmin_platform.c:386:19: error: implicit declaration of function ‘i2c_acpi_find_client_by_adev’; did you mean ‘i2c_acpi_find_adapter_by_handle’? [-Werror=implicit-function-declaration]
	  386 |         *client = i2c_acpi_find_client_by_adev(adev);
	      |                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
	      |                   i2c_acpi_find_adapter_by_handle
	drivers/staging/media/atomisp/pci/atomisp_gmin_platform.c:386:17: warning: assignment to ‘struct i2c_client *’ from ‘int’ makes pointer from integer without a cast [-Wint-conversion]
	  386 |         *client = i2c_acpi_find_client_by_adev(adev);
	      |                 ^

The reason is because such function is static:

	$ git grep i2c_acpi_find_client_by_adev
	drivers/i2c/i2c-core-acpi.c:static struct i2c_client *i2c_acpi_find_client_by_adev(struct acpi_device *adev)

IMO, a patch like that should be applied at the same tree as a patch
dropping "static" from drivers/i2c/i2c-core-acpi.c. If you want to do
so, feel free to add:

Reviewed-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>

> ---
>  .../staging/media/atomisp/pci/atomisp_gmin_platform.c    | 9 ++-------
>  1 file changed, 2 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/staging/media/atomisp/pci/atomisp_gmin_platform.c b/drivers/staging/media/atomisp/pci/atomisp_gmin_platform.c
> index 135994d44802..a1064d1a3d6b 100644
> --- a/drivers/staging/media/atomisp/pci/atomisp_gmin_platform.c
> +++ b/drivers/staging/media/atomisp/pci/atomisp_gmin_platform.c
> @@ -378,19 +378,14 @@ static struct i2c_client *gmin_i2c_dev_exists(struct device *dev, char *name,
>  					      struct i2c_client **client)
>  {
>  	struct acpi_device *adev;
> -	struct device *d;
>  
>  	adev = acpi_dev_get_first_match_dev(name, NULL, -1);
>  	if (!adev)
>  		return NULL;
>  
> -	d = bus_find_device_by_acpi_dev(&i2c_bus_type, adev);
> -	acpi_dev_put(adev);
> -	if (!d)
> -		return NULL;
> +	*client = i2c_acpi_find_client_by_adev(adev);
>  
> -	*client = i2c_verify_client(d);
> -	put_device(d);
> +	acpi_dev_put(adev);
>  
>  	dev_dbg(dev, "found '%s' at address 0x%02x, adapter %d\n",
>  		(*client)->name, (*client)->addr, (*client)->adapter->nr);



Thanks,
Mauro

  reply	other threads:[~2021-07-22  8:57 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-26 12:43 [PATCH v1 1/6] i2c: acpi: Export i2c_acpi_find_client_by_adev() for users Andy Shevchenko
2021-05-26 12:43 ` [PATCH v1 2/6] staging: atomisp: Replace open-coded i2c_acpi_find_client_by_adev() Andy Shevchenko
2021-07-22  8:57   ` Mauro Carvalho Chehab [this message]
2021-07-22  9:02     ` Andy Shevchenko
2021-05-26 12:43 ` [PATCH v1 3/6] staging: atomisp: Remove unused declarations Andy Shevchenko
2021-05-26 12:43 ` [PATCH v1 4/6] staging: atomisp: Annotate a couple of definitions with __maybe_unused Andy Shevchenko
2021-05-26 12:43 ` [PATCH v1 5/6] staging: atomisp: Move MIPI_PORT_LANES to the only user Andy Shevchenko
2021-05-26 18:23   ` kernel test robot
2021-05-26 12:43 ` [PATCH v1 6/6] staging: atomisp: Remove unused port_enabled variable Andy Shevchenko
2021-05-27 20:26 ` [PATCH v1 1/6] i2c: acpi: Export i2c_acpi_find_client_by_adev() for users Wolfram Sang
2021-05-28  9:23   ` Andy Shevchenko
2021-05-28  9:25     ` Andy Shevchenko
2021-05-28  9:25   ` Greg Kroah-Hartman
2021-05-28  9:34     ` Andy Shevchenko
2021-05-28 10:01       ` Wolfram Sang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210722105744.4a94d58d@coco.lan \
    --to=mchehab+huawei@kernel.org \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=hdegoede@redhat.com \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    --cc=mchehab@kernel.org \
    --cc=mika.westerberg@linux.intel.com \
    --cc=sakari.ailus@linux.intel.com \
    --cc=wsa@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).