[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <e1e41178-b4b6-4f3e-b88b-e35090262da9@lucaceresoli.net>
Date: Thu, 14 Oct 2021 10:25:44 +0200
From: Luca Ceresoli <luca@...aceresoli.net>
To: Krzysztof Kozlowski <krzysztof.kozlowski@...onical.com>,
linux-kernel@...r.kernel.org
Cc: Lee Jones <lee.jones@...aro.org>, Rob Herring <robh+dt@...nel.org>,
Alessandro Zummo <a.zummo@...ertech.it>,
Alexandre Belloni <alexandre.belloni@...tlin.com>,
Chanwoo Choi <cw00.choi@...sung.com>,
Bartlomiej Zolnierkiewicz <b.zolnierkie@...sung.com>,
Wim Van Sebroeck <wim@...ux-watchdog.org>,
Guenter Roeck <linux@...ck-us.net>, devicetree@...r.kernel.org,
linux-rtc@...r.kernel.org, linux-watchdog@...r.kernel.org,
Chiwoong Byun <woong.byun@...sung.com>,
Laxman Dewangan <ldewangan@...dia.com>
Subject: Re: [PATCH 6/8] mfd: max77714: Add driver for Maxim MAX77714 PMIC
Hi,
On 14/10/21 09:40, Krzysztof Kozlowski wrote:
[...]
>>>> +
>>>> +static const struct of_device_id max77714_dt_match[] = {
>>>> + { .compatible = "maxim,max77714" },
>>>> + {},
>>>> +};
>>>
>>> When converting to module - don't forget the MODULE_DEVICE_TABLE
>>>
>>>> +
>>>> +static struct i2c_driver max77714_driver = {
>>>> + .driver = {
>>>> + .name = "max77714",
>>>> + .of_match_table = of_match_ptr(max77714_dt_match),
>>>
>>> Kbuild robot pointed it out - of_matc_ptr should not be needed, even for
>>> compile testing without OF.
>>
>> I wonder whether it's better to add '#ifdef CONFIG_OF / #endif' around
>> the struct of_device_id declaration. I think it's what most drivers do,
>> even though I tend to prefer not adding #ifdefs making code less clean
>> only for COMPILE_TESTING.
>
> No, most drivers added it long time ago before we switched it to a new
> way - either __maybe_unused or without anything even. The point is that
> OF driver can be reused for ACPI platforms. If you limit it with ifdef
> or of_match_ptr, the ACPI platform won't have any table to use for binding.
Oh, I see, thanks for the clarification.
I wonder if it makes sense to mass-remove all of them and remove the macro.
--
Luca
Powered by blists - more mailing lists