From: Stephen Warren <swarren@wwwdotorg.org>
To: Tony Prisk <linux@prisktech.co.nz>
Cc: vt8500-wm8505-linux-kernel@googlegroups.com,
Russell King <linux@arm.linux.org.uk>,
Arnd Bergmann <arnd@arndb.de>,
Alessandro Zummo <a.zummo@towertech.it>,
Grant Likely <grant.likely@secretlab.ca>,
Rob Herring <rob.herring@calxeda.com>,
Alan Cox <alan@linux.intel.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Alan Stern <stern@rowland.harvard.edu>,
Hauke Mehrtens <hauke@hauke-m.de>, Felipe Balbi <balbi@ti.com>,
Neil Zhang <zhangwm@marvell.com>,
Florian Tobias Schandinat <FlorianSchandinat@gmx.de>,
Rob Landley <rob@landley.net>,
Mark Brown <broonie@opensource.wolfsonmicro.com>,
Stephen Warren <swarren@nvidia.com>,
Eric Andersson <eric.andersson@unixphere.com>,
Linus Walleij <linus.walleij@stericsson.com>,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org,
linux-fbdev@vger.kernel.org, linux-usb@vger.kernel.org,
linux-serial@vger.kernel.org, rtc-linux@googlegroups.com,
devicetree-discuss@lists.ozlabs.org
Subject: Re: [PATCH 8/8] ARM: vt8500: gpio: Devicetree support for arch-vt8500
Date: Wed, 08 Aug 2012 12:38:58 -0600 [thread overview]
Message-ID: <5022B242.1050001@wwwdotorg.org> (raw)
In-Reply-To: <1344389967-8465-9-git-send-email-linux@prisktech.co.nz>
On 08/07/2012 07:39 PM, Tony Prisk wrote:
> Converted the existing arch-vt8500 gpio to a platform_device.
> Added support for WM8505 and WM8650 GPIO controllers.
> diff --git a/drivers/gpio/gpio-vt8500.c b/drivers/gpio/gpio-vt8500.c
> +static struct of_device_id vt8500_gpio_dt_ids[] = {
> + { .compatible = "via,vt8500-gpio", .data = &vt8500_data, },
> + { .compatible = "wm,wm8505-gpio", .data = &wm8505_data, },
> + { .compatible = "wm,wm8650-gpio", .data = &wm8650_data, },
> + { /* Sentinel */ },
> +};
> +
> +static int __devinit vt8500_gpio_probe(struct platform_device *pdev)
> +{
> + void __iomem *gpio_base;
> + struct device_node *np;
> + const struct of_device_id *of_id =
> + of_match_device(vt8500_gpio_dt_ids, &pdev->dev);
> +
> + if (!of_id) {
> + dev_err(&pdev->dev, "Failed to find gpio controller\n");
> + return -ENODEV;
> + }
> +
> + np = of_find_matching_node(NULL, vt8500_gpio_dt_ids);
Can't you use pdev->dev.of_node instead of searching for it again?
...
> + of_node_put(np);
If so, you could also remove that.
> +static int __init vt8500_gpio_init(void)
> +{
> + return platform_driver_probe(&vt8500_gpio_driver, &vt8500_gpio_probe);
> +}
> +
> +static void __exit vt8500_gpio_exit(void)
> +{
> + return platform_driver_unregister(&vt8500_gpio_driver);
> +}
> +
> +module_init(vt8500_gpio_init);
> +module_exit(vt8500_gpio_exit);
I think that's all just:
module_platform_driver(vt8500_gpio_driver);
(except that _init uses platform_driver_probe() rather than
platform_driver_register(), which seems unusual. I guess that explains
the of_find_matching_node() above too.)
> +MODULE_LICENSE("GPL");
That should be "GPL v2" given the license header.
next prev parent reply other threads:[~2012-08-08 18:39 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-08 1:39 [PATCH 0/8] *** ARM: Update arch-vt8500 to Devicetree *** Tony Prisk
2012-08-08 1:39 ` [PATCH 1/8] arm: vt8500: Add device tree files for VIA/Wondermedia SoC's Tony Prisk
2012-08-08 18:43 ` Stephen Warren
2012-08-08 1:39 ` [PATCH 2/8] rtc: vt8500: Add devicetree support for vt8500-rtc Tony Prisk
2012-08-08 1:39 ` [PATCH 3/8] serial: vt8500: Add devicetree support for vt8500-serial Tony Prisk
2012-08-08 1:39 ` [PATCH 4/8] usb: vt8500: Add devicetree support for vt8500-ehci and -uhci Tony Prisk
2012-08-08 1:39 ` [PATCH 5/8] video: vt8500: Add devicetree support for vt8500-fb and wm8505-fb Tony Prisk
2012-08-08 18:47 ` Stephen Warren
2012-08-08 1:39 ` [PATCH 6/8] arm: vt8500: Update arch-vt8500 to devicetree support Tony Prisk
2012-08-08 18:58 ` Stephen Warren
2012-08-08 1:39 ` [PATCH 7/8] arm: vt8500: doc: Add device tree bindings for arch-vt8500 devices Tony Prisk
2012-08-08 1:39 ` [PATCH 8/8] ARM: vt8500: gpio: Devicetree support for arch-vt8500 Tony Prisk
2012-08-08 9:11 ` [rtc-linux] " Linus Walleij
2012-08-08 9:19 ` Arnd Bergmann
2012-08-08 14:28 ` Linus Walleij
2012-08-08 18:38 ` Stephen Warren [this message]
2012-08-08 19:17 ` Arnd Bergmann
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=5022B242.1050001@wwwdotorg.org \
--to=swarren@wwwdotorg.org \
--cc=FlorianSchandinat@gmx.de \
--cc=a.zummo@towertech.it \
--cc=alan@linux.intel.com \
--cc=arnd@arndb.de \
--cc=balbi@ti.com \
--cc=broonie@opensource.wolfsonmicro.com \
--cc=devicetree-discuss@lists.ozlabs.org \
--cc=eric.andersson@unixphere.com \
--cc=grant.likely@secretlab.ca \
--cc=gregkh@linuxfoundation.org \
--cc=hauke@hauke-m.de \
--cc=linus.walleij@stericsson.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-fbdev@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=linux@arm.linux.org.uk \
--cc=linux@prisktech.co.nz \
--cc=rob.herring@calxeda.com \
--cc=rob@landley.net \
--cc=rtc-linux@googlegroups.com \
--cc=stern@rowland.harvard.edu \
--cc=swarren@nvidia.com \
--cc=vt8500-wm8505-linux-kernel@googlegroups.com \
--cc=zhangwm@marvell.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