From: Marc Dietrich <marvin24@gmx.de>
To: Thierry Reding <thierry.reding@avionic-design.de>
Cc: linux-tegra@vger.kernel.org, Stephen Warren <swarren@nvidia.com>,
Colin Cross <ccross@android.com>, Olof Johansson <olof@lixom.net>,
linux-wireless@vger.kernel.org,
"John W. Linville" <linville@tuxdriver.com>,
Johannes Berg <johannes@sipsolutions.net>,
Rhyland Klein <rklein@nvidia.com>
Subject: Re: Re: [PATCH 1/3] net: rfkill-gpio: add device tree support
Date: Mon, 06 Feb 2012 11:25:31 +0100 [thread overview]
Message-ID: <2558096.AGHIzMrJ53@fb07-iapwap2> (raw)
In-Reply-To: <20120205195924.GA18267@avionic-0098.adnet.avionic-design.de>
Am Sonntag, 5. Februar 2012, 20:59:24 schrieb Thierry Reding:
> * Marc Dietrich wrote:
> > +#ifdef CONFIG_OF
>
> [...]
>
> > +#else
>
> [...]
>
> > +#define of_rfkill_gpio_match NULL
>
> This can be dropped, see below.
>
> > +#endif
> > +
> >
> > static int rfkill_gpio_probe(struct platform_device *pdev)
> > {
> >
> > struct rfkill_gpio_data *rfkill;
> > struct rfkill_gpio_platform_data *pdata = pdev->dev.platform_data;
> >
> > + struct device_node *np = pdev->dev.of_node;
> >
> > int ret = 0;
> > int len = 0;
> >
> > + if (np)
> > + pdata = rfkill_gpio_parse_pdata(pdev);
> > +
> >
> > if (!pdata) {
> >
> > pr_warn("%s: No platform data specified\n", __func__);
> > return -EINVAL;
> >
> > @@ -210,13 +268,13 @@ static int rfkill_gpio_remove(struct platform_device
> > *pdev)>
> > return 0;
> >
> > }
> >
> > -
>
> Are you removing this line on purpose?
of course not ;-)
> > static struct platform_driver rfkill_gpio_driver = {
> >
> > .probe = rfkill_gpio_probe,
> > .remove = __devexit_p(rfkill_gpio_remove),
> > .driver = {
> >
> > .name = "rfkill_gpio",
> > .owner = THIS_MODULE,
> >
> > + .of_match_table = of_rfkill_gpio_match,
>
> I think the canonical way to do this is of_match_ptr() and leave out the
> definition to NULL in the !CONFIG_OF above.
yes, the OF api is changing in such a fast way, that it is getting hard to track it,
especially if there are many drivers which use different generations of it.
I'll fix it up in the next iteration.
Thanks
Marc
prev parent reply other threads:[~2012-02-06 10:25 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-05 17:18 [PATCH 1/3] net: rfkill-gpio: add device tree support Marc Dietrich
2012-02-05 17:18 ` [PATCH 2/3] dt: rfkill-gpio: add bindings documentation Marc Dietrich
2012-02-05 22:00 ` Olof Johansson
2012-02-06 10:16 ` Marc Dietrich
2012-02-05 19:59 ` [PATCH 1/3] net: rfkill-gpio: add device tree support Thierry Reding
2012-02-06 10:25 ` Marc Dietrich [this message]
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=2558096.AGHIzMrJ53@fb07-iapwap2 \
--to=marvin24@gmx.de \
--cc=ccross@android.com \
--cc=johannes@sipsolutions.net \
--cc=linux-tegra@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=linville@tuxdriver.com \
--cc=olof@lixom.net \
--cc=rklein@nvidia.com \
--cc=swarren@nvidia.com \
--cc=thierry.reding@avionic-design.de \
/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