Skip to contentSkip to conversation

input: pwm-beeper: Fix module autoload for OF platform driver

PATCH Superseded Luis de Bethencourt 2 participants 2 messages Aug 27, 2015 – Aug 29, 2015

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 2/6 input: pwm-beeper: Fix module autoload for OF platform driver

This platform driver has a OF device ID table but the OF module alias information is not created so module autoloading won't work.

---
 drivers/input/misc/pwm-beeper.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/input/misc/pwm-beeper.c +2 -0
index e82edf8..a02b9a4 100644
@@ -175,6 +175,8 @@ static const struct of_device_id pwm_beeper_match[] = {
 };
 #endif
 
+MODULE_DEVICE_TABLE(of, pwm_beeper_match);
+
 static struct platform_driver pwm_beeper_driver = {
 	.probe	= pwm_beeper_probe,
 	.remove = pwm_beeper_remove,
Signature · 1 line
2.4.6
maintainer
#1 lore raw

Hi Luis,

Quoted 13 lines · Luis de Bethencourt

This platform driver has a OF device ID table but the OF module alias information is not created so module autoloading won't work.

---
 drivers/input/misc/pwm-beeper.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/input/misc/pwm-beeper.c +0 -0
index e82edf8..a02b9a4 100644

drivers/input/misc/pwm-beeper.c static const struct of_device_id pwm_beeper_match[] = { · line 179

Quoted 5 lines
drivers/input/misc/pwm-beeper.c +2 -0
@@ -175,6 +175,8 @@ static const struct of_device_id pwm_beeper_match[] = {
 };
 #endif
 
+MODULE_DEVICE_TABLE(of, pwm_beeper_match);
+

I'm fairly certain this (ano others) blow up in case of !CONFIG_OF. Please bring MODULE_DEVICE_TABLE into #ifdef block above.

Quoted 6 lines
drivers/input/misc/pwm-beeper.c +0 -1
 static struct platform_driver pwm_beeper_driver = {
        .probe  = pwm_beeper_probe,
        .remove = pwm_beeper_remove,
--

2.4.6

Thanks.

Signature · 1 line
Dmitry