linux-acpi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1 1/2] i2c: core: Don't fail PRP0001 enumeration when no ID table exist
@ 2020-08-21 17:03 Andy Shevchenko
  2020-08-21 17:03 ` [PATCH v1 2/2] i2c: acpi: Remove dead code, i.e. i2c_acpi_match_device() Andy Shevchenko
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Andy Shevchenko @ 2020-08-21 17:03 UTC (permalink / raw)
  To: Mika Westerberg, linux-acpi, Wolfram Sang, linux-i2c; +Cc: Andy Shevchenko

When commit c64ffff7a9d1 ("i2c: core: Allow empty id_table in ACPI case
as well") fixed the enumeration of I²C devices on ACPI enabled platforms
when driver has no ID table, it missed the PRP0001 support.

i2c_device_match() and i2c_acpi_match_device() differently match
driver against given device. Use acpi_driver_match_device(), that is used
in the former, in i2c_device_probe() and don't fail PRP0001 enumeration
when no ID table exist.

Fixes: c64ffff7a9d1 ("i2c: core: Allow empty id_table in ACPI case as well")
BugLink: https://stackoverflow.com/q/63519678/2511795
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/i2c/i2c-core-base.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/i2c/i2c-core-base.c b/drivers/i2c/i2c-core-base.c
index 34a9609f256d..5ec082e2039d 100644
--- a/drivers/i2c/i2c-core-base.c
+++ b/drivers/i2c/i2c-core-base.c
@@ -480,7 +480,7 @@ static int i2c_device_probe(struct device *dev)
 	 * or ACPI ID table is supplied for the probing device.
 	 */
 	if (!driver->id_table &&
-	    !i2c_acpi_match_device(dev->driver->acpi_match_table, client) &&
+	    !acpi_driver_match_device(dev, dev->driver) &&
 	    !i2c_of_match_device(dev->driver->of_match_table, client)) {
 		status = -ENODEV;
 		goto put_sync_adapter;
-- 
2.28.0


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

* [PATCH v1 2/2] i2c: acpi: Remove dead code, i.e. i2c_acpi_match_device()
  2020-08-21 17:03 [PATCH v1 1/2] i2c: core: Don't fail PRP0001 enumeration when no ID table exist Andy Shevchenko
@ 2020-08-21 17:03 ` Andy Shevchenko
  2020-08-24  8:42   ` Mika Westerberg
  2020-08-25  7:23   ` Wolfram Sang
  2020-08-24  8:41 ` [PATCH v1 1/2] i2c: core: Don't fail PRP0001 enumeration when no ID table exist Mika Westerberg
  2020-08-25  7:23 ` Wolfram Sang
  2 siblings, 2 replies; 7+ messages in thread
From: Andy Shevchenko @ 2020-08-21 17:03 UTC (permalink / raw)
  To: Mika Westerberg, linux-acpi, Wolfram Sang, linux-i2c; +Cc: Andy Shevchenko

We have no users of i2c_acpi_match_device() anymore and seems
will not have them in the future, thus remove dead code.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/i2c/i2c-core-acpi.c | 10 ----------
 drivers/i2c/i2c-core.h      |  9 ---------
 2 files changed, 19 deletions(-)

diff --git a/drivers/i2c/i2c-core-acpi.c b/drivers/i2c/i2c-core-acpi.c
index 2ade99b105b9..e627d7b2790f 100644
--- a/drivers/i2c/i2c-core-acpi.c
+++ b/drivers/i2c/i2c-core-acpi.c
@@ -276,16 +276,6 @@ void i2c_acpi_register_devices(struct i2c_adapter *adap)
 		dev_warn(&adap->dev, "failed to enumerate I2C slaves\n");
 }
 
-const struct acpi_device_id *
-i2c_acpi_match_device(const struct acpi_device_id *matches,
-		      struct i2c_client *client)
-{
-	if (!(client && matches))
-		return NULL;
-
-	return acpi_match_device(matches, &client->dev);
-}
-
 static const struct acpi_device_id i2c_acpi_force_400khz_device_ids[] = {
 	/*
 	 * These Silead touchscreen controllers only work at 400KHz, for
diff --git a/drivers/i2c/i2c-core.h b/drivers/i2c/i2c-core.h
index 94ff1693b391..8ce261167a2d 100644
--- a/drivers/i2c/i2c-core.h
+++ b/drivers/i2c/i2c-core.h
@@ -59,20 +59,11 @@ static inline int __i2c_check_suspended(struct i2c_adapter *adap)
 }
 
 #ifdef CONFIG_ACPI
-const struct acpi_device_id *
-i2c_acpi_match_device(const struct acpi_device_id *matches,
-		      struct i2c_client *client);
 void i2c_acpi_register_devices(struct i2c_adapter *adap);
 
 int i2c_acpi_get_irq(struct i2c_client *client);
 #else /* CONFIG_ACPI */
 static inline void i2c_acpi_register_devices(struct i2c_adapter *adap) { }
-static inline const struct acpi_device_id *
-i2c_acpi_match_device(const struct acpi_device_id *matches,
-		      struct i2c_client *client)
-{
-	return NULL;
-}
 
 static inline int i2c_acpi_get_irq(struct i2c_client *client)
 {
-- 
2.28.0


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

* Re: [PATCH v1 1/2] i2c: core: Don't fail PRP0001 enumeration when no ID table exist
  2020-08-21 17:03 [PATCH v1 1/2] i2c: core: Don't fail PRP0001 enumeration when no ID table exist Andy Shevchenko
  2020-08-21 17:03 ` [PATCH v1 2/2] i2c: acpi: Remove dead code, i.e. i2c_acpi_match_device() Andy Shevchenko
@ 2020-08-24  8:41 ` Mika Westerberg
  2020-08-25  7:23 ` Wolfram Sang
  2 siblings, 0 replies; 7+ messages in thread
From: Mika Westerberg @ 2020-08-24  8:41 UTC (permalink / raw)
  To: Andy Shevchenko; +Cc: linux-acpi, Wolfram Sang, linux-i2c

On Fri, Aug 21, 2020 at 08:03:33PM +0300, Andy Shevchenko wrote:
> When commit c64ffff7a9d1 ("i2c: core: Allow empty id_table in ACPI case
> as well") fixed the enumeration of I²C devices on ACPI enabled platforms
> when driver has no ID table, it missed the PRP0001 support.
> 
> i2c_device_match() and i2c_acpi_match_device() differently match
> driver against given device. Use acpi_driver_match_device(), that is used
> in the former, in i2c_device_probe() and don't fail PRP0001 enumeration
> when no ID table exist.
> 
> Fixes: c64ffff7a9d1 ("i2c: core: Allow empty id_table in ACPI case as well")
> BugLink: https://stackoverflow.com/q/63519678/2511795
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com>

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

* Re: [PATCH v1 2/2] i2c: acpi: Remove dead code, i.e. i2c_acpi_match_device()
  2020-08-21 17:03 ` [PATCH v1 2/2] i2c: acpi: Remove dead code, i.e. i2c_acpi_match_device() Andy Shevchenko
@ 2020-08-24  8:42   ` Mika Westerberg
  2020-08-25  7:23   ` Wolfram Sang
  1 sibling, 0 replies; 7+ messages in thread
From: Mika Westerberg @ 2020-08-24  8:42 UTC (permalink / raw)
  To: Andy Shevchenko; +Cc: linux-acpi, Wolfram Sang, linux-i2c

On Fri, Aug 21, 2020 at 08:03:34PM +0300, Andy Shevchenko wrote:
> We have no users of i2c_acpi_match_device() anymore and seems
> will not have them in the future, thus remove dead code.
> 
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com>

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

* Re: [PATCH v1 1/2] i2c: core: Don't fail PRP0001 enumeration when no ID table exist
  2020-08-21 17:03 [PATCH v1 1/2] i2c: core: Don't fail PRP0001 enumeration when no ID table exist Andy Shevchenko
  2020-08-21 17:03 ` [PATCH v1 2/2] i2c: acpi: Remove dead code, i.e. i2c_acpi_match_device() Andy Shevchenko
  2020-08-24  8:41 ` [PATCH v1 1/2] i2c: core: Don't fail PRP0001 enumeration when no ID table exist Mika Westerberg
@ 2020-08-25  7:23 ` Wolfram Sang
  2020-08-25 10:12   ` Andy Shevchenko
  2 siblings, 1 reply; 7+ messages in thread
From: Wolfram Sang @ 2020-08-25  7:23 UTC (permalink / raw)
  To: Andy Shevchenko; +Cc: Mika Westerberg, linux-acpi, linux-i2c

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

On Fri, Aug 21, 2020 at 08:03:33PM +0300, Andy Shevchenko wrote:
> When commit c64ffff7a9d1 ("i2c: core: Allow empty id_table in ACPI case
> as well") fixed the enumeration of I²C devices on ACPI enabled platforms
> when driver has no ID table, it missed the PRP0001 support.
> 
> i2c_device_match() and i2c_acpi_match_device() differently match
> driver against given device. Use acpi_driver_match_device(), that is used
> in the former, in i2c_device_probe() and don't fail PRP0001 enumeration
> when no ID table exist.
> 
> Fixes: c64ffff7a9d1 ("i2c: core: Allow empty id_table in ACPI case as well")
> BugLink: https://stackoverflow.com/q/63519678/2511795

You are monitoring SO? Nice.

> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

Applied to for-current, thanks!


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

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

* Re: [PATCH v1 2/2] i2c: acpi: Remove dead code, i.e. i2c_acpi_match_device()
  2020-08-21 17:03 ` [PATCH v1 2/2] i2c: acpi: Remove dead code, i.e. i2c_acpi_match_device() Andy Shevchenko
  2020-08-24  8:42   ` Mika Westerberg
@ 2020-08-25  7:23   ` Wolfram Sang
  1 sibling, 0 replies; 7+ messages in thread
From: Wolfram Sang @ 2020-08-25  7:23 UTC (permalink / raw)
  To: Andy Shevchenko; +Cc: Mika Westerberg, linux-acpi, linux-i2c

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

On Fri, Aug 21, 2020 at 08:03:34PM +0300, Andy Shevchenko wrote:
> We have no users of i2c_acpi_match_device() anymore and seems
> will not have them in the future, thus remove dead code.
> 
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

Applied to for-current, thanks!


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

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

* Re: [PATCH v1 1/2] i2c: core: Don't fail PRP0001 enumeration when no ID table exist
  2020-08-25  7:23 ` Wolfram Sang
@ 2020-08-25 10:12   ` Andy Shevchenko
  0 siblings, 0 replies; 7+ messages in thread
From: Andy Shevchenko @ 2020-08-25 10:12 UTC (permalink / raw)
  To: Wolfram Sang; +Cc: Mika Westerberg, linux-acpi, linux-i2c

On Tue, Aug 25, 2020 at 09:23:14AM +0200, Wolfram Sang wrote:
> On Fri, Aug 21, 2020 at 08:03:33PM +0300, Andy Shevchenko wrote:
> > When commit c64ffff7a9d1 ("i2c: core: Allow empty id_table in ACPI case
> > as well") fixed the enumeration of I²C devices on ACPI enabled platforms
> > when driver has no ID table, it missed the PRP0001 support.
> > 
> > i2c_device_match() and i2c_acpi_match_device() differently match
> > driver against given device. Use acpi_driver_match_device(), that is used
> > in the former, in i2c_device_probe() and don't fail PRP0001 enumeration
> > when no ID table exist.
> > 
> > Fixes: c64ffff7a9d1 ("i2c: core: Allow empty id_table in ACPI case as well")
> > BugLink: https://stackoverflow.com/q/63519678/2511795
> 
> You are monitoring SO? Nice.

Monitoring is probably too strong word here, rather sometimes looking for
interesting topics (mostly related to ACPI + Linux (kernel) and near to them).

This makes me wonder how many commits are actually referring to SO.
The 1st one I found is 8c88f87cb27a ("netfilter: nfnetlink_queue: add NAT TCP
sequence adjustment if packet mangled"). Some of them referring stackexchange
site, but not many (brief estimation like a couple of dozens at most).

> > Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> 
> Applied to for-current, thanks!

Thanks!

-- 
With Best Regards,
Andy Shevchenko



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

end of thread, other threads:[~2020-08-25 10:13 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-21 17:03 [PATCH v1 1/2] i2c: core: Don't fail PRP0001 enumeration when no ID table exist Andy Shevchenko
2020-08-21 17:03 ` [PATCH v1 2/2] i2c: acpi: Remove dead code, i.e. i2c_acpi_match_device() Andy Shevchenko
2020-08-24  8:42   ` Mika Westerberg
2020-08-25  7:23   ` Wolfram Sang
2020-08-24  8:41 ` [PATCH v1 1/2] i2c: core: Don't fail PRP0001 enumeration when no ID table exist Mika Westerberg
2020-08-25  7:23 ` Wolfram Sang
2020-08-25 10:12   ` Andy Shevchenko

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).