From: Jingoo Han <jg1.han@samsung.com>
To: 'Thierry Reding' <thierry.reding@gmail.com>
Cc: linux-pwm@vger.kernel.org, 'Jingoo Han' <jg1.han@samsung.com>,
'Eric Miao' <eric.y.miao@gmail.com>
Subject: [PATCH v2] pwm: pxa: Use of_match_ptr()
Date: Thu, 03 Apr 2014 12:44:54 +0900 [thread overview]
Message-ID: <000d01cf4eef$13881770$3a984650$%han@samsung.com> (raw)
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
next reply other threads:[~2014-04-03 3:44 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-03 3:44 Jingoo Han [this message]
2014-04-04 8:49 ` [PATCH v2] pwm: pxa: Use of_match_ptr() Thierry Reding
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='000d01cf4eef$13881770$3a984650$%han@samsung.com' \
--to=jg1.han@samsung.com \
--cc=eric.y.miao@gmail.com \
--cc=linux-pwm@vger.kernel.org \
--cc=thierry.reding@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).