[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <45f6e5e0-c145-40d9-8f0a-ffb25ecffb28@kernel.org>
Date: Sat, 21 Dec 2024 21:35:22 +0100
From: Krzysztof Kozlowski <krzk@...nel.org>
To: mathieu.dubois-briand@...tlin.com, Lee Jones <lee@...nel.org>,
Rob Herring <robh@...nel.org>, Krzysztof Kozlowski <krzk+dt@...nel.org>,
Conor Dooley <conor+dt@...nel.org>, Kamel Bouhara
<kamel.bouhara@...tlin.com>, Linus Walleij <linus.walleij@...aro.org>,
Bartosz Golaszewski <brgl@...ev.pl>,
Dmitry Torokhov <dmitry.torokhov@...il.com>,
Uwe Kleine-König <ukleinek@...nel.org>
Cc: devicetree@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-gpio@...r.kernel.org, linux-input@...r.kernel.org,
linux-pwm@...r.kernel.org, Grégory Clement
<gregory.clement@...tlin.com>,
Thomas Petazzoni <thomas.petazzoni@...tlin.com>
Subject: Re: [PATCH 4/8] pwm: max7360: Add MAX7360 PWM support
On 19/12/2024 17:21, mathieu.dubois-briand@...tlin.com wrote:
> From: Kamel Bouhara <kamel.bouhara@...tlin.com>
>
> Add driver for Maxim Integrated MAX7360 PWM controller, supporting up to
> 8 independent PWM outputs.
>
...
> +
> +#ifdef CONFIG_OF
> +static const struct of_device_id max7360_pwm_of_match[] = {
> + { .compatible = "maxim,max7360-pwm", },
> + { }
> +};
> +MODULE_DEVICE_TABLE(of, max7360_pwm_of_match);
> +#endif
> +
> +static struct platform_driver max7360_pwm_driver = {
> + .driver = {
> + .name = "max7360-pwm",
> + .of_match_table = of_match_ptr(max7360_pwm_of_match),
Better to drop of_match_ptr and #ifdef earlier, so ACPI could use it.
> + },
> + .probe = max7360_pwm_probe,
> +};
> +module_platform_driver(max7360_pwm_driver);
> +
> +MODULE_DESCRIPTION("MAX7360 PWM driver");
> +MODULE_AUTHOR("Kamel BOUHARA <kamel.bouhara@...tlin.com>");
> +MODULE_ALIAS("platform:max7360-pwm");
You should not need MODULE_ALIAS() in normal cases. If you need it,
usually it means your device ID table is wrong (e.g. misses either
entries or MODULE_DEVICE_TABLE()). MODULE_ALIAS() is not a substitute
for incomplete ID table.
Maybe you need it because OF table will get dropped, then it would be
fine. But in current code it's unnecessary and copy-pasta from other
drivers.
Best regards,
Krzysztof
Powered by blists - more mailing lists