Re: [PATCH v5 12/13] i2c: qcom-geni: Store of_device_id data in driver private struct

From: Konrad Dybcio

Date: Tue Feb 17 2026 - 06:46:36 EST


On 2/6/26 6:41 PM, Praveen Talari wrote:
> To avoid repeatedly fetching and checking platform data across various
> functions, store the struct of_device_id data directly in the i2c
> private structure. This change enhances code maintainability and reduces
> redundancy.
>
> Acked-by: Viken Dadhaniya <viken.dadhaniya@xxxxxxxxxxxxxxxx>
> Signed-off-by: Praveen Talari <praveen.talari@xxxxxxxxxxxxxxxx>
> ---

[...]

> - desc = device_get_match_data(&pdev->dev);
> + gi2c->dev_data = device_get_match_data(&pdev->dev);
> + if (!gi2c->dev_data)
> + return -EINVAL;

This is an improvement, but you still need this:

diff --git a/drivers/i2c/busses/i2c-qcom-geni.c b/drivers/i2c/busses/i2c-qcom-geni.c
index ae609bdd2ec4..08e5a1917933 100644
--- a/drivers/i2c/busses/i2c-qcom-geni.c
+++ b/drivers/i2c/busses/i2c-qcom-geni.c
@@ -933,8 +933,8 @@ static const struct i2c_algorithm geni_i2c_algo = {

#ifdef CONFIG_ACPI
static const struct acpi_device_id geni_i2c_acpi_match[] = {
- { "QCOM0220"},
- { "QCOM0411" },
+ { "QCOM0220", (kernel_ulong_t)&geni_i2c},
+ { "QCOM0411", (kernel_ulong_t)&geni_i2c },
{ }
};
MODULE_DEVICE_TABLE(acpi, geni_i2c_acpi_match);

for this check to not fail

Konrad