linux-i2c.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] i2c: core: Do not print duplicate error when failing to register an i2c-client from ACPI
@ 2020-12-21 19:13 Hans de Goede
  2020-12-21 19:24 ` Andy Shevchenko
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Hans de Goede @ 2020-12-21 19:13 UTC (permalink / raw)
  To: Wolfram Sang, Andy Shevchenko, Mika Westerberg
  Cc: Hans de Goede, linux-i2c, linux-acpi

i2c_new_client_device() already prints an error when it fails. Some
ACPI tables contain 2 ACPI devices describing the same i2c-client,
leading to errors like this:

[    1.620847] i2c i2c-4: Failed to register i2c client MAGN0001:00 at 0x1d (-16)
[    1.620870] i2c i2c-4: failed to add I2C device MAGN0001:00 from ACPI

There is nothing we can do about the first -EBUSY error being logged,
but the second error does not really add any new information, so lets
drop it.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
 drivers/i2c/i2c-core-acpi.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/drivers/i2c/i2c-core-acpi.c b/drivers/i2c/i2c-core-acpi.c
index 37c510d9347a..8ceaa88dd78f 100644
--- a/drivers/i2c/i2c-core-acpi.c
+++ b/drivers/i2c/i2c-core-acpi.c
@@ -225,12 +225,8 @@ static void i2c_acpi_register_device(struct i2c_adapter *adapter,
 	adev->power.flags.ignore_parent = true;
 	acpi_device_set_enumerated(adev);
 
-	if (IS_ERR(i2c_new_client_device(adapter, info))) {
+	if (IS_ERR(i2c_new_client_device(adapter, info)))
 		adev->power.flags.ignore_parent = false;
-		dev_err(&adapter->dev,
-			"failed to add I2C device %s from ACPI\n",
-			dev_name(&adev->dev));
-	}
 }
 
 static acpi_status i2c_acpi_add_device(acpi_handle handle, u32 level,
-- 
2.28.0


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

* Re: [PATCH] i2c: core: Do not print duplicate error when failing to register an i2c-client from ACPI
  2020-12-21 19:13 [PATCH] i2c: core: Do not print duplicate error when failing to register an i2c-client from ACPI Hans de Goede
@ 2020-12-21 19:24 ` Andy Shevchenko
  2020-12-22  9:18 ` Mika Westerberg
  2021-01-05 10:00 ` Wolfram Sang
  2 siblings, 0 replies; 4+ messages in thread
From: Andy Shevchenko @ 2020-12-21 19:24 UTC (permalink / raw)
  To: Hans de Goede
  Cc: Wolfram Sang, Andy Shevchenko, Mika Westerberg, linux-i2c,
	ACPI Devel Maling List

On Mon, Dec 21, 2020 at 9:13 PM Hans de Goede <hdegoede@redhat.com> wrote:
>
> i2c_new_client_device() already prints an error when it fails. Some
> ACPI tables contain 2 ACPI devices describing the same i2c-client,
> leading to errors like this:
>
> [    1.620847] i2c i2c-4: Failed to register i2c client MAGN0001:00 at 0x1d (-16)
> [    1.620870] i2c i2c-4: failed to add I2C device MAGN0001:00 from ACPI
>
> There is nothing we can do about the first -EBUSY error being logged,
> but the second error does not really add any new information, so lets
> drop it.

Makes sense to me,
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>

> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
> ---
>  drivers/i2c/i2c-core-acpi.c | 6 +-----
>  1 file changed, 1 insertion(+), 5 deletions(-)
>
> diff --git a/drivers/i2c/i2c-core-acpi.c b/drivers/i2c/i2c-core-acpi.c
> index 37c510d9347a..8ceaa88dd78f 100644
> --- a/drivers/i2c/i2c-core-acpi.c
> +++ b/drivers/i2c/i2c-core-acpi.c
> @@ -225,12 +225,8 @@ static void i2c_acpi_register_device(struct i2c_adapter *adapter,
>         adev->power.flags.ignore_parent = true;
>         acpi_device_set_enumerated(adev);
>
> -       if (IS_ERR(i2c_new_client_device(adapter, info))) {
> +       if (IS_ERR(i2c_new_client_device(adapter, info)))
>                 adev->power.flags.ignore_parent = false;
> -               dev_err(&adapter->dev,
> -                       "failed to add I2C device %s from ACPI\n",
> -                       dev_name(&adev->dev));
> -       }
>  }
>
>  static acpi_status i2c_acpi_add_device(acpi_handle handle, u32 level,
> --
> 2.28.0
>


-- 
With Best Regards,
Andy Shevchenko

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

* Re: [PATCH] i2c: core: Do not print duplicate error when failing to register an i2c-client from ACPI
  2020-12-21 19:13 [PATCH] i2c: core: Do not print duplicate error when failing to register an i2c-client from ACPI Hans de Goede
  2020-12-21 19:24 ` Andy Shevchenko
@ 2020-12-22  9:18 ` Mika Westerberg
  2021-01-05 10:00 ` Wolfram Sang
  2 siblings, 0 replies; 4+ messages in thread
From: Mika Westerberg @ 2020-12-22  9:18 UTC (permalink / raw)
  To: Hans de Goede; +Cc: Wolfram Sang, Andy Shevchenko, linux-i2c, linux-acpi

On Mon, Dec 21, 2020 at 08:13:00PM +0100, Hans de Goede wrote:
> i2c_new_client_device() already prints an error when it fails. Some
> ACPI tables contain 2 ACPI devices describing the same i2c-client,
> leading to errors like this:
> 
> [    1.620847] i2c i2c-4: Failed to register i2c client MAGN0001:00 at 0x1d (-16)
> [    1.620870] i2c i2c-4: failed to add I2C device MAGN0001:00 from ACPI
> 
> There is nothing we can do about the first -EBUSY error being logged,
> but the second error does not really add any new information, so lets
> drop it.
> 
> Signed-off-by: Hans de Goede <hdegoede@redhat.com>

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

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

* Re: [PATCH] i2c: core: Do not print duplicate error when failing to register an i2c-client from ACPI
  2020-12-21 19:13 [PATCH] i2c: core: Do not print duplicate error when failing to register an i2c-client from ACPI Hans de Goede
  2020-12-21 19:24 ` Andy Shevchenko
  2020-12-22  9:18 ` Mika Westerberg
@ 2021-01-05 10:00 ` Wolfram Sang
  2 siblings, 0 replies; 4+ messages in thread
From: Wolfram Sang @ 2021-01-05 10:00 UTC (permalink / raw)
  To: Hans de Goede; +Cc: Andy Shevchenko, Mika Westerberg, linux-i2c, linux-acpi

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

On Mon, Dec 21, 2020 at 08:13:00PM +0100, Hans de Goede wrote:
> i2c_new_client_device() already prints an error when it fails. Some
> ACPI tables contain 2 ACPI devices describing the same i2c-client,
> leading to errors like this:
> 
> [    1.620847] i2c i2c-4: Failed to register i2c client MAGN0001:00 at 0x1d (-16)
> [    1.620870] i2c i2c-4: failed to add I2C device MAGN0001:00 from ACPI
> 
> There is nothing we can do about the first -EBUSY error being logged,
> but the second error does not really add any new information, so lets
> drop it.
> 
> Signed-off-by: Hans de Goede <hdegoede@redhat.com>

Applied to for-next, thanks!


[-- 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-01-05 10:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-21 19:13 [PATCH] i2c: core: Do not print duplicate error when failing to register an i2c-client from ACPI Hans de Goede
2020-12-21 19:24 ` Andy Shevchenko
2020-12-22  9:18 ` Mika Westerberg
2021-01-05 10:00 ` 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).