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

From: Konrad Dybcio

Date: Wed Feb 04 2026 - 08:47:59 EST


On 2/4/26 6:04 AM, Praveen Talari wrote:
> Hi Konrad,
>
> On 2/3/2026 5:55 PM, Konrad Dybcio wrote:
>> On 2/2/26 7:09 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);
>>
>> Because you dereference it unconditionally later, this should be
>> null-checked
>
> Initially this was added, but based on Bjorn’s comment like there is no possibility of getting a null value here since we are already adding the platform data to compatibles

The ACPI match entries don't have it, which I think gives a good
example of how easy this may be overlooked

Konrad