public inbox for linux-i2c@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1] i2c: core: Allow empty id_table in ACPI case as well
@ 2017-07-06 18:01 Andy Shevchenko
  2017-07-06 18:05 ` Hans de Goede
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Andy Shevchenko @ 2017-07-06 18:01 UTC (permalink / raw)
  To: Wolfram Sang, linux-i2c, Hans de Goede, Rafael J . Wysocki,
	linux-acpi, Mika Westerberg
  Cc: Andy Shevchenko

For now empty ID table is not allowed with ACPI and prevents driver to be
probed.

Add a check to allow empty ID table.

Fixes: da10c06a044b ("i2c: Make I2C ID tables non-mandatory for DT'ed devices")
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/i2c/i2c-core-base.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/i2c/i2c-core-base.c b/drivers/i2c/i2c-core-base.c
index c89dac7fd2e7..45231d2257ad 100644
--- a/drivers/i2c/i2c-core-base.c
+++ b/drivers/i2c/i2c-core-base.c
@@ -354,9 +354,10 @@ static int i2c_device_probe(struct device *dev)
 
 	/*
 	 * An I2C ID table is not mandatory, if and only if, a suitable Device
-	 * Tree match table entry is supplied for the probing device.
+	 * Tree or ACPI match table entry is supplied for the probing device.
 	 */
 	if (!driver->id_table &&
+	    !acpi_match_device(dev->driver->acpi_match_table, &client->dev) &&
 	    !i2c_of_match_device(dev->driver->of_match_table, client))
 		return -ENODEV;
 
-- 
2.11.0


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

* Re: [PATCH v1] i2c: core: Allow empty id_table in ACPI case as well
  2017-07-06 18:01 [PATCH v1] i2c: core: Allow empty id_table in ACPI case as well Andy Shevchenko
@ 2017-07-06 18:05 ` Hans de Goede
  2017-07-08 19:57 ` Wolfram Sang
  2017-07-08 20:58 ` Wolfram Sang
  2 siblings, 0 replies; 5+ messages in thread
From: Hans de Goede @ 2017-07-06 18:05 UTC (permalink / raw)
  To: Andy Shevchenko, Wolfram Sang, linux-i2c, Rafael J . Wysocki,
	linux-acpi, Mika Westerberg

Hi,

Thank you for doing this.

On 06-07-17 20:01, Andy Shevchenko wrote:
> For now empty ID table is not allowed with ACPI and prevents driver to be
> probed.
> 
> Add a check to allow empty ID table.
> 
> Fixes: da10c06a044b ("i2c: Make I2C ID tables non-mandatory for DT'ed devices")
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

Looks good to me:

Reviewed-by: Hans de Goede <hdegoede@redhat.com>

Regards,

Hans


> ---
>   drivers/i2c/i2c-core-base.c | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/i2c/i2c-core-base.c b/drivers/i2c/i2c-core-base.c
> index c89dac7fd2e7..45231d2257ad 100644
> --- a/drivers/i2c/i2c-core-base.c
> +++ b/drivers/i2c/i2c-core-base.c
> @@ -354,9 +354,10 @@ static int i2c_device_probe(struct device *dev)
>   
>   	/*
>   	 * An I2C ID table is not mandatory, if and only if, a suitable Device
> -	 * Tree match table entry is supplied for the probing device.
> +	 * Tree or ACPI match table entry is supplied for the probing device.
>   	 */
>   	if (!driver->id_table &&
> +	    !acpi_match_device(dev->driver->acpi_match_table, &client->dev) &&
>   	    !i2c_of_match_device(dev->driver->of_match_table, client))
>   		return -ENODEV;
>   
> 

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

* Re: [PATCH v1] i2c: core: Allow empty id_table in ACPI case as well
  2017-07-06 18:01 [PATCH v1] i2c: core: Allow empty id_table in ACPI case as well Andy Shevchenko
  2017-07-06 18:05 ` Hans de Goede
@ 2017-07-08 19:57 ` Wolfram Sang
  2017-07-08 20:16   ` Andy Shevchenko
  2017-07-08 20:58 ` Wolfram Sang
  2 siblings, 1 reply; 5+ messages in thread
From: Wolfram Sang @ 2017-07-08 19:57 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: linux-i2c, Hans de Goede, Rafael J . Wysocki, linux-acpi,
	Mika Westerberg

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

On Thu, Jul 06, 2017 at 09:01:40PM +0300, Andy Shevchenko wrote:
> For now empty ID table is not allowed with ACPI and prevents driver to be
> probed.
> 
> Add a check to allow empty ID table.
> 
> Fixes: da10c06a044b ("i2c: Make I2C ID tables non-mandatory for DT'ed devices")
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

Do we need this for 4.13 already?


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

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

* Re: [PATCH v1] i2c: core: Allow empty id_table in ACPI case as well
  2017-07-08 19:57 ` Wolfram Sang
@ 2017-07-08 20:16   ` Andy Shevchenko
  0 siblings, 0 replies; 5+ messages in thread
From: Andy Shevchenko @ 2017-07-08 20:16 UTC (permalink / raw)
  To: Wolfram Sang
  Cc: linux-i2c, Hans de Goede, Rafael J . Wysocki, linux-acpi,
	Mika Westerberg

On Sat, 2017-07-08 at 21:57 +0200, Wolfram Sang wrote:
> On Thu, Jul 06, 2017 at 09:01:40PM +0300, Andy Shevchenko wrote:
> > For now empty ID table is not allowed with ACPI and prevents driver
> > to be
> > probed.
> > 
> > Add a check to allow empty ID table.
> > 
> > Fixes: da10c06a044b ("i2c: Make I2C ID tables non-mandatory for
> > DT'ed devices")
> > Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> 
> Do we need this for 4.13 already?
> 

Yes (we have NFC chip which relies on it), even better down to stable
kernels which have mentioned commit.

-- 
Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Intel Finland Oy

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

* Re: [PATCH v1] i2c: core: Allow empty id_table in ACPI case as well
  2017-07-06 18:01 [PATCH v1] i2c: core: Allow empty id_table in ACPI case as well Andy Shevchenko
  2017-07-06 18:05 ` Hans de Goede
  2017-07-08 19:57 ` Wolfram Sang
@ 2017-07-08 20:58 ` Wolfram Sang
  2 siblings, 0 replies; 5+ messages in thread
From: Wolfram Sang @ 2017-07-08 20:58 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: linux-i2c, Hans de Goede, Rafael J . Wysocki, linux-acpi,
	Mika Westerberg

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

On Thu, Jul 06, 2017 at 09:01:40PM +0300, Andy Shevchenko wrote:
> For now empty ID table is not allowed with ACPI and prevents driver to be
> probed.
> 
> Add a check to allow empty ID table.
> 
> Fixes: da10c06a044b ("i2c: Make I2C ID tables non-mandatory for DT'ed devices")
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

Applied to for-4.13, thanks!


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

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

end of thread, other threads:[~2017-07-08 20:58 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-07-06 18:01 [PATCH v1] i2c: core: Allow empty id_table in ACPI case as well Andy Shevchenko
2017-07-06 18:05 ` Hans de Goede
2017-07-08 19:57 ` Wolfram Sang
2017-07-08 20:16   ` Andy Shevchenko
2017-07-08 20:58 ` Wolfram Sang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox