Thread (2 messages) 2 messages, 2 authors, 2012-09-27

Re: [PATCH] input: pwm-beeper: Add devicetree probing support

From: Thierry Reding <hidden>
Date: 2012-09-27 19:39:17

On Tue, Sep 25, 2012 at 09:15:51AM +0200, Sascha Hauer wrote:
[...]
quoted hunk ↗ jump to hunk
diff --git a/drivers/input/misc/pwm-beeper.c b/drivers/input/misc/pwm-beeper.c
index fc84c8a..dfb3c50 100644
--- a/drivers/input/misc/pwm-beeper.c
+++ b/drivers/input/misc/pwm-beeper.c
[...]
quoted hunk ↗ jump to hunk
@@ -171,6 +175,11 @@ static SIMPLE_DEV_PM_OPS(pwm_beeper_pm_ops,
 #define PWM_BEEPER_PM_OPS NULL
 #endif
 
+static const struct of_device_id pwm_beeper_match[] = {
+	{ .compatible = "pwm-beeper", },
+	{ },
+};
+
This is usually protected by #ifdef CONFIG_OF...
quoted hunk ↗ jump to hunk
 static struct platform_driver pwm_beeper_driver = {
 	.probe	= pwm_beeper_probe,
 	.remove = __devexit_p(pwm_beeper_remove),
@@ -178,6 +187,7 @@ static struct platform_driver pwm_beeper_driver = {
 		.name	= "pwm-beeper",
 		.owner	= THIS_MODULE,
 		.pm	= PWM_BEEPER_PM_OPS,
+		.of_match_table = pwm_beeper_match,
... and this of_match_ptr(pwm_beeper_match). They aren't technically
necessary but I guess it makes sense to not keep them around for !OF
configurations in order to save some bytes.

Thierry

Attachments

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help