linux-pwm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] pwm: pxa: Use of_match_ptr()
@ 2014-04-03  3:44 Jingoo Han
  2014-04-04  8:49 ` Thierry Reding
  0 siblings, 1 reply; 2+ messages in thread
From: Jingoo Han @ 2014-04-03  3:44 UTC (permalink / raw)
  To: 'Thierry Reding'
  Cc: linux-pwm, 'Jingoo Han', 'Eric Miao'

Use of_match_ptr(), because of_match_ptr() returns NULL pointer
when CONFIG_OF is disabled.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
---
Changes since v1:
- Add of_match_ptr() to of_match_device() in order to fix compile error
  when CONFIG_OF=n.

 drivers/pwm/pwm-pxa.c |    7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/pwm/pwm-pxa.c b/drivers/pwm/pwm-pxa.c
index cd356d8..024e6a4 100644
--- a/drivers/pwm/pwm-pxa.c
+++ b/drivers/pwm/pwm-pxa.c
@@ -140,14 +140,13 @@ static const struct of_device_id pwm_of_match[] = {
 	{ }
 };
 MODULE_DEVICE_TABLE(of, pwm_of_match);
-#else
-#define pwm_of_match NULL
 #endif
 
 static const struct platform_device_id *pxa_pwm_get_id_dt(struct device *dev)
 {
-	const struct of_device_id *id = of_match_device(pwm_of_match, dev);
+	const struct of_device_id *id;
 
+	id = of_match_device(of_match_ptr(pwm_of_match), dev);
 	return id ? id->data : NULL;
 }
 
@@ -228,7 +227,7 @@ static struct platform_driver pwm_driver = {
 	.driver		= {
 		.name	= "pxa25x-pwm",
 		.owner	= THIS_MODULE,
-		.of_match_table = pwm_of_match,
+		.of_match_table = of_match_ptr(pwm_of_match),
 	},
 	.probe		= pwm_probe,
 	.remove		= pwm_remove,
-- 
1.7.10.4



^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-04-04  8:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-04-03  3:44 [PATCH v2] pwm: pxa: Use of_match_ptr() Jingoo Han
2014-04-04  8:49 ` Thierry Reding

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).