linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Srinivas Neeli <srinivas.neeli@xilinx.com>
To: <linus.walleij@linaro.org>, <bgolaszewski@baylibre.com>,
	<michal.simek@xilinx.com>, <shubhrajyoti.datta@xilinx.com>,
	<sgoud@xilinx.com>
Cc: <linux-gpio@vger.kernel.org>,
	<linux-arm-kernel@lists.infradead.org>,
	<linux-kernel@vger.kernel.org>, <git@xilinx.com>,
	Srinivas Neeli <srinivas.neeli@xilinx.com>
Subject: [PATCH 1/3] gpio: zynq: use module_platform_driver to simplify the code
Date: Fri, 9 Apr 2021 19:38:04 +0530	[thread overview]
Message-ID: <20210409140806.31824-2-srinivas.neeli@xilinx.com> (raw)
In-Reply-To: <20210409140806.31824-1-srinivas.neeli@xilinx.com>

module_platform_driver() makes the code simpler by eliminating
boilerplate code.

Signed-off-by: Srinivas Neeli <srinivas.neeli@xilinx.com>
---
 drivers/gpio/gpio-zynq.c | 17 +----------------
 1 file changed, 1 insertion(+), 16 deletions(-)

diff --git a/drivers/gpio/gpio-zynq.c b/drivers/gpio/gpio-zynq.c
index 3521c1dc3ac0..bb1ac0c5cf26 100644
--- a/drivers/gpio/gpio-zynq.c
+++ b/drivers/gpio/gpio-zynq.c
@@ -1020,22 +1020,7 @@ static struct platform_driver zynq_gpio_driver = {
 	.remove = zynq_gpio_remove,
 };
 
-/**
- * zynq_gpio_init - Initial driver registration call
- *
- * Return: value from platform_driver_register
- */
-static int __init zynq_gpio_init(void)
-{
-	return platform_driver_register(&zynq_gpio_driver);
-}
-postcore_initcall(zynq_gpio_init);
-
-static void __exit zynq_gpio_exit(void)
-{
-	platform_driver_unregister(&zynq_gpio_driver);
-}
-module_exit(zynq_gpio_exit);
+module_platform_driver(zynq_gpio_driver);
 
 MODULE_AUTHOR("Xilinx Inc.");
 MODULE_DESCRIPTION("Zynq GPIO driver");
-- 
2.9.1


  reply	other threads:[~2021-04-09 14:08 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-09 14:08 [PATCH 0/3] gpio: zynq: Update on gpio zynq driver Srinivas Neeli
2021-04-09 14:08 ` Srinivas Neeli [this message]
     [not found]   ` <CAHp75Vddd6ygr4mJ9Z+SuGZmfLcgDLWLZaxby2XE2mX8War-qQ@mail.gmail.com>
2021-04-13 10:43     ` [PATCH 1/3] gpio: zynq: use module_platform_driver to simplify the code Bartosz Golaszewski
2021-04-14 14:45       ` Srinivas Neeli
2021-04-16 18:27         ` Bartosz Golaszewski
2021-04-17 11:06           ` Andy Shevchenko
2021-06-14 10:39           ` Srinivas Neeli
2021-06-14 18:22             ` Bartosz Golaszewski
2021-04-09 14:08 ` [PATCH 2/3] gpio: zynq: Check return value of pm_runtime_get_sync Srinivas Neeli
2021-04-09 14:08 ` [PATCH 3/3] gpio: zynq: Check return value of irq_get_irq_data Srinivas Neeli
2021-04-17 18:02   ` Deepak R Varma

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=20210409140806.31824-2-srinivas.neeli@xilinx.com \
    --to=srinivas.neeli@xilinx.com \
    --cc=bgolaszewski@baylibre.com \
    --cc=git@xilinx.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=michal.simek@xilinx.com \
    --cc=sgoud@xilinx.com \
    --cc=shubhrajyoti.datta@xilinx.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).