lkml.org 
[lkml]   [2022]   [Mar]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH 2/2] regulator: rt5759: Add support for Richtek RT5759 DCDC converter
From
On 25/03/2022 16:50, ChiYuan Huang wrote:
> Krzysztof Kozlowski <krzk@kernel.org> 於 2022年3月25日 週五 下午11:37寫道:
>>
>> On 25/03/2022 15:59, ChiYuan Huang wrote:
>>> Krzysztof Kozlowski <krzk@kernel.org> 於 2022年3月25日 週五 下午10:47寫道:
>>>>
>>>>>>> +
>>>>>>> +static const struct of_device_id __maybe_unused rt5759_device_table[] = {
>>>>>>
>>>>>> I don't think this can be __maybe_unused. It is always referenced via
>>>>>> of_match_table, isn't it?
>>>>>>
>>>>> I think it can declared as '__maybe_unused'.
>>>>> If 'of_device_id' is unused, then in probe stage,
>>>>> 'of_device_get_match_data' will return NULL.
>>>>
>>>> But your of_device_id cannot be unused. It is always referenced.
>>>>
>>> I'm not sure, but your assumption is based on 'CONFIG_OF', right?
>>> Only if 'CONFIG_OF' is not defined, then it'll be really unused.
>>
>> Is it possible to build this driver without CONFIG_OF? Did you try it?
>>
> No, my development board always use device tree that's defined CONFIG_OF.
>
> But theoretically, you can also check of_device.h, if CONFIG_OF is not
> defined, 'of_device_get_match_data' always return NULL.
> If so, my usage is still right.

No, it does not look right and your arguments are not even related to
the topic. I don't think we talk about the same thing.

You mention board, some of_device_get_match_data() so you talk about
runtime. maybe_unused is not about runtime. It is about build time.

The code you sent cannot have this structure unused. If you think
otherwise, please provide argument, but not about runtime (again). You
can for example build it without OF and see...

Best regards,
Krzysztof

\
 
 \ /
  Last update: 2022-03-25 16:56    [W:0.058 / U:0.536 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site