diff mbox series

[RFC,2/4] platform/x86: i2c-multi-instantiate: Set i2c_board_info.irq to -ENOENT when no IRQ is specified

Message ID 20201105080014.45410-3-hdegoede@redhat.com
State New
Headers show
Series platform/x86: i2c-multi-instantiate: Pass ACPI fwnode to instantiated i2c-clients | expand

Commit Message

Hans de Goede Nov. 5, 2020, 8 a.m. UTC
In some cases the i2c-driver may need access to the ACPI-fwnode as
that may contain ACPI-methods supplying e.g. orientation-matrix info
for accelerometers.

Setting i2c_board_info.fwnode to point to the ACPI-fwnode, while
leaving i2c_board_info.irq set to 0 (in the IRQ_RESOURCE_NONE case)
will cause the i2c-core to assign the first IRQ described in the ACPI
resources to the client, which we do not want.

Set i2c_board_info.irq to -ENOENT instead of 0 in the IRQ_RESOURCE_NONE
case, to avoid this issue.

This is a preparation patch for passing the fwnode to i2c_acpi_new_device.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
 drivers/platform/x86/i2c-multi-instantiate.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/drivers/platform/x86/i2c-multi-instantiate.c b/drivers/platform/x86/i2c-multi-instantiate.c
index 6acc8457866e..cb4688bdd6b6 100644
--- a/drivers/platform/x86/i2c-multi-instantiate.c
+++ b/drivers/platform/x86/i2c-multi-instantiate.c
@@ -113,7 +113,7 @@  static int i2c_multi_inst_probe(struct platform_device *pdev)
 			board_info.irq = ret;
 			break;
 		default:
-			board_info.irq = 0;
+			board_info.irq = -ENOENT;
 			break;
 		}
 		multi->clients[i] = i2c_acpi_new_device(dev, i, &board_info);