Skip to content

Commit fb90e58

Browse files
committed
i2c: acpi: Use acpi_dev_ready_for_enumeration() helper
The clk and regulator frameworks expect clk/regulator consumer-devices to have info about the consumed clks/regulators described in the device's fw_node. To work around cases where this info is not present in the firmware tables, which is often the case on x86/ACPI devices, both frameworks allow the provider-driver to attach info about consumers to the clks/regulators when registering these. This causes problems with the probe ordering wrt drivers for consumers of these clks/regulators. Since the lookups are only registered when the provider-driver binds, trying to get these clks/regulators before then results in a -ENOENT error for clks and a dummy regulator for regulators. To ensure the correct probe-ordering the ACPI core has code to defer the enumeration of consumers affected by this until the providers are ready. Call the new acpi_dev_ready_for_enumeration() helper to avoid enumerating / instantiating i2c-clients too early. Acked-by: Wolfram Sang <[email protected]> Acked-by: Rafael J. Wysocki <[email protected]> Reviewed-by: Andy Shevchenko <[email protected]> Acked-by: Mika Westerberg <[email protected]> Signed-off-by: Hans de Goede <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 9d9bcae commit fb90e58

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

drivers/i2c/i2c-core-acpi.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,9 +144,12 @@ static int i2c_acpi_do_lookup(struct acpi_device *adev,
144144
struct list_head resource_list;
145145
int ret;
146146

147-
if (acpi_bus_get_status(adev) || !adev->status.present)
147+
if (acpi_bus_get_status(adev))
148148
return -EINVAL;
149149

150+
if (!acpi_dev_ready_for_enumeration(adev))
151+
return -ENODEV;
152+
150153
if (acpi_match_device_ids(adev, i2c_acpi_ignored_device_ids) == 0)
151154
return -ENODEV;
152155

0 commit comments

Comments
 (0)