lkml.org 
[lkml]   [2021]   [Oct]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 6/8] mfd: max77714: Add driver for Maxim MAX77714 PMIC
From
Date
On 13/10/2021 23:39, Luca Ceresoli wrote:
> Hi,
>
> On 12/10/21 10:32, Krzysztof Kozlowski wrote:
>> On 11/10/2021 17:56, Luca Ceresoli wrote:
>>> Add a simple driver for the Maxim MAX77714 PMIC, supporting RTC and
>>> watchdog only.
>>>
>>> Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
>>> ---
>>> MAINTAINERS | 2 +
>>> drivers/mfd/Kconfig | 14 ++++
>>> drivers/mfd/Makefile | 1 +
>>> drivers/mfd/max77714.c | 151 +++++++++++++++++++++++++++++++++++
>>> include/linux/mfd/max77714.h | 68 ++++++++++++++++
>>> 5 files changed, 236 insertions(+)
>>> create mode 100644 drivers/mfd/max77714.c
>>> create mode 100644 include/linux/mfd/max77714.h
>>>
>>
>> (...)
>>
>>> +
>>> +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.

Best regards,
Krzysztof

\
 
 \ /
  Last update: 2021-10-14 09:40    [W:0.411 / U:0.312 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site