Re: [PATCH 4/8] pwm: max7360: Add MAX7360 PWM support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 19/12/2024 17:21, mathieu.dubois-briand@xxxxxxxxxxx wrote:
> From: Kamel Bouhara <kamel.bouhara@xxxxxxxxxxx>
> 
> 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@xxxxxxxxxxx>");
> +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




[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux