Thread (9 messages) 9 messages, 2 authors, 2014-09-23

Re: [PATCH v2 2/3] power: gpio-charger: add device tree support

From: Doug Anderson <hidden>
Date: 2014-09-23 15:59:47
Also in: linux-pm, lkml

Heiko,

On Tue, Sep 23, 2014 at 5:03 AM, Heiko Stübner [off-list ref] wrote:
Am Montag, 22. September 2014, 09:48:33 schrieb Doug Anderson:
quoted
quoted
@@ -196,6 +255,7 @@ static struct platform_driver gpio_charger_driver = {

                .name = "gpio-charger",
                .owner = THIS_MODULE,
                .pm = &gpio_charger_pm_ops,

+               .of_match_table = of_match_ptr(gpio_charger_match),
Given that you don't have any #ifdefs with "CONFIG_OF", I think
gpio_charger_match will always exist.  It seems like you should remove
the of_match_ptr or add some #ifdefs.  I can't quite keep up with what
the currently suggested best practice is here, though.
I've kept the of_match_ptr in v3. The dt parsing functions (of_read_foo,...)
define stubs for the !CONFIG_OF case which we use here in this case and
of_match_ptr is also defined differently for both OF and !OF, so it feels like
it should be there ;-)
...I was thinking you'd get a compile-time warning about
gpio_charger_match not being used.  ...but I can't seem to trigger it
with my compiler settings.  In any case, I'm fairly certain that in
the !CONFIG_OF case (plus non-module case) that "gpio_charger_match"
will be defined but not used in your code.

I was under the impression that of_match_ptr was defined differently
for OF and !OF so that you could use it in the case where the
structure itself (gpio_charger_match) had #ifdefs around it...
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help