Skip to contentSkip to conversation

i2c: core: Do not print duplicate error when failing to register an i2c-client from ACPI

PATCH Applied Hans de Goede 4 participants 4 messages Dec 21, 2020 – Jan 5, 2021

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 i2c: core: Do not print duplicate error when failing to register an i2c-client from 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.

---
 drivers/i2c/i2c-core-acpi.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)
drivers/i2c/i2c-core-acpi.c +1 -5
index 37c510d9347a..8ceaa88dd78f 100644
@@ -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,
Signature · 1 line
2.28.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 11 lines · Hans de Goede

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,

Quoted 26 lines
---
 drivers/i2c/i2c-core-acpi.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)
drivers/i2c/i2c-core-acpi.c +1 -6
index 37c510d9347a..8ceaa88dd78f 100644
@@ -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

Signature · 2 lines
With Best Regards,
Andy Shevchenko
Reviewed-by on v1 1/1
#2 lore raw
In reply to Hans de Goede
Quoted 4 lines · Hans de Goede

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:

Quoted 8 lines
[    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.

Applied
#3 lore raw
In reply to Hans de Goede
Quoted 4 lines · Hans de Goede

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:

Quoted 8 lines
[    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.

Applied to for-next, thanks!