Skip to content

Commit

Permalink
i2c: ljca: Call acpi_dev_clear_dependencies()
Browse files Browse the repository at this point in the history
Call acpi_dev_clear_dependencies() to mark _DEP ACPI dependencies on
the I2C controller as satisfied so that acpi_dev_ready_for_enumeration()
for the I2C device nodes in APCI will return true once the I2C controller
is registered.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
  • Loading branch information
jwrdegoede authored and wentongwu committed Nov 18, 2022
1 parent 215aa25 commit 70d9526
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion drivers/i2c/busses/i2c-ljca.c
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,16 @@ static int ljca_i2c_probe(struct platform_device *pdev)
return -EIO;
}

return i2c_add_adapter(&ljca_i2c->adap);
ret = i2c_add_adapter(&ljca_i2c->adap);
if (ret)
return ret;

#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 17, 0)
if (has_acpi_companion(&ljca_i2c->adap.dev))
acpi_dev_clear_dependencies(ACPI_COMPANION(&ljca_i2c->adap.dev));
#endif

return 0;
}

static int ljca_i2c_remove(struct platform_device *pdev)
Expand Down

0 comments on commit 70d9526

Please sign in to comment.