Skip to contentSkip to conversation

pwm: atmel-hlcdc: workaround

PATCH In review Liao Chen 2 participants 4 messages Aug 31, 2024 – Sep 4, 2024

Subsystems (2)
lore
Share & tools
lore

Liao Chen

author
#0 lore raw

cover pwm: atmel-hlcdc: workaround

Hi all,

This patch enables the autoloading feature of atmel-hlcdc module. By registering MDT, the kernel is allowed to automatically bind modules to devices that match the specified compatible strings. This patch also drops trailing comma from definitions of device table arrays, which makes the code robust against misrebases.

Liao Chen (2):
pwm: atmel-hlcdc: Enable module autoloading
pwm: atmel-hlcdc: Drop trailing comma

 drivers/pwm/pwm-atmel-hlcdc.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
Signature · 1 line
2.34.1
author
#1 lore raw

PATCH 1/2 pwm: atmel-hlcdc: Enable module autoloading

Add MODULE_DEVICE_TABLE(), so modules could be properly autoloaded based on the alias from of_device_id table.

---
 drivers/pwm/pwm-atmel-hlcdc.c | 1 +
 1 file changed, 1 insertion(+)
drivers/pwm/pwm-atmel-hlcdc.c +1 -0
index 2afb302be02c..02660bd811c4 100644
@@ -290,6 +290,7 @@ static const struct of_device_id atmel_hlcdc_pwm_dt_ids[] = {
 	{ .compatible = "atmel,hlcdc-pwm" },
 	{ /* sentinel */ },
 };
+MODULE_DEVICE_TABLE(of, atmel_hlcdc_pwm_dt_ids);
 
 static struct platform_driver atmel_hlcdc_pwm_driver = {
 	.driver = {
Signature · 1 line
2.34.1
author
#2 lore raw

PATCH 2/2 pwm: atmel-hlcdc: Drop trailing comma

In reply to Liao Chen

Drop the trailing comma in the terminator entry for the ID table to make code robust against misrebases.

---
 drivers/pwm/pwm-atmel-hlcdc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/pwm/pwm-atmel-hlcdc.c +2 -2
index 02660bd811c4..eb39955a6d77 100644
@@ -234,7 +234,7 @@ static const struct of_device_id atmel_hlcdc_dt_ids[] = {
 		.data = &atmel_hlcdc_pwm_sama5d3_errata,
 	},
 	{	.compatible = "microchip,sam9x60-hlcdc", },
-	{ /* sentinel */ },
+	{ /* sentinel */ }
 };
 MODULE_DEVICE_TABLE(of, atmel_hlcdc_dt_ids);
 
@@ -288,7 +288,7 @@ static void atmel_hlcdc_pwm_remove(struct platform_device *pdev)
 
 static const struct of_device_id atmel_hlcdc_pwm_dt_ids[] = {
 	{ .compatible = "atmel,hlcdc-pwm" },
-	{ /* sentinel */ },
+	{ /* sentinel */ }
 };
 MODULE_DEVICE_TABLE(of, atmel_hlcdc_pwm_dt_ids);
 
Signature · 1 line
2.34.1
#3 lore raw
In reply to Liao Chen

Hello,

Quoted 5 lines · Liao Chen

This patch enables the autoloading feature of atmel-hlcdc module. By registering MDT, the kernel is allowed to automatically bind modules to devices that match the specified compatible strings. This patch also drops trailing comma from definitions of device table arrays, which makes the code robust against misrebases.

Applied this series to
https://git.kernel.org/pub/scm/linux/kernel/git/ukleinek/linux.git pwm/for-next

Best regards and thanks for your contribution,
Uwe