linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Axel Lin <axel.lin@ingics.com>
To: Linus Walleij <linus.walleij@linaro.org>
Cc: Christian Ruppert <christian.ruppert@abilis.com>,
	Kumar Gala <galak@codeaurora.org>,
	Sascha Leuenberger <sascha.leuenberger@abilis.com>,
	linux-gpio@vger.kernel.org
Subject: [PATCH 2/2] gpio: tb10x: Convert to use module_platform_driver
Date: Thu, 31 Oct 2013 10:03:02 +0800	[thread overview]
Message-ID: <1383184982.13635.3.camel@phoenix> (raw)
In-Reply-To: <1383184905.13635.1.camel@phoenix>

Use module_platform_driver to simplify the code.
In additional, this is a DT only driver, thus also remove of_match_ptr.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
---
 drivers/gpio/gpio-tb10x.c | 14 ++------------
 1 file changed, 2 insertions(+), 12 deletions(-)

diff --git a/drivers/gpio/gpio-tb10x.c b/drivers/gpio/gpio-tb10x.c
index 45bfed1..a0391bc 100644
--- a/drivers/gpio/gpio-tb10x.c
+++ b/drivers/gpio/gpio-tb10x.c
@@ -311,23 +311,13 @@ static struct platform_driver tb10x_gpio_driver = {
 	.remove		= tb10x_gpio_remove,
 	.driver = {
 		.name	= "tb10x-gpio",
-		.of_match_table = of_match_ptr(tb10x_gpio_dt_ids),
+		.of_match_table = tb10x_gpio_dt_ids,
 		.owner	= THIS_MODULE,
 	}
 };
 
-static int __init ab_gpio_init(void)
-{
-	return platform_driver_register(&tb10x_gpio_driver);
-}
-
-static void __exit ab_gpio_exit(void)
-{
-	platform_driver_unregister(&tb10x_gpio_driver);
-}
+module_platform_driver(tb10x_gpio_driver);
 
-module_init(ab_gpio_init);
-module_exit(ab_gpio_exit);
 MODULE_LICENSE("GPL");
 MODULE_DESCRIPTION("tb10x gpio.");
 MODULE_VERSION("0.0.1");
-- 
1.8.1.2




  reply	other threads:[~2013-10-31  2:03 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-31  2:01 [PATCH 1/2] gpio: tb10x: Fix checking return value of devm_ioremap_resource Axel Lin
2013-10-31  2:03 ` Axel Lin [this message]
2013-10-31 12:41   ` [PATCH 2/2] gpio: tb10x: Convert to use module_platform_driver Christian Ruppert
2013-11-12 19:36   ` Linus Walleij
2013-10-31 12:40 ` [PATCH 1/2] gpio: tb10x: Fix checking return value of devm_ioremap_resource Christian Ruppert
2013-11-01 13:28   ` Axel Lin

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=1383184982.13635.3.camel@phoenix \
    --to=axel.lin@ingics.com \
    --cc=christian.ruppert@abilis.com \
    --cc=galak@codeaurora.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=sascha.leuenberger@abilis.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).