All of lore.kernel.org
 help / color / mirror / Atom feed
From: Shraddha Barke <shraddha.6596@gmail.com>
To: outreachy-kernel@googlegroups.com
Cc: Shraddha Barke <shraddha.6596@gmail.com>
Subject: [PATCH 2/2] Staging: gdm724x: gdm_mux.c: Use module_usb_driver
Date: Tue, 29 Sep 2015 10:26:49 +0530	[thread overview]
Message-ID: <1443502609-9918-2-git-send-email-shraddha.6596@gmail.com> (raw)
In-Reply-To: <1443502609-9918-1-git-send-email-shraddha.6596@gmail.com>

Macro module_usb_driver is used for drivers whose init
and exit paths does only register and unregister. Remove boilerplate code
by using module_usb_driver.

Signed-off-by: Shraddha Barke <shraddha.6596@gmail.com>
---
 drivers/staging/gdm724x/gdm_mux.c | 29 +----------------------------
 1 file changed, 1 insertion(+), 28 deletions(-)

diff --git a/drivers/staging/gdm724x/gdm_mux.c b/drivers/staging/gdm724x/gdm_mux.c
index 1cf24e4..7cd9b87 100644
--- a/drivers/staging/gdm724x/gdm_mux.c
+++ b/drivers/staging/gdm724x/gdm_mux.c
@@ -658,34 +658,7 @@ static struct usb_driver gdm_mux_driver = {
 	.reset_resume = gdm_mux_resume,
 };
 
-static int __init gdm_usb_mux_init(void)
-{
-
-	mux_rx_wq = create_workqueue("mux_rx_wq");
-	if (mux_rx_wq == NULL) {
-		pr_err("work queue create fail\n");
-		return -1;
-	}
-
-	register_lte_tty_driver();
-
-	return usb_register(&gdm_mux_driver);
-}
-
-static void __exit gdm_usb_mux_exit(void)
-{
-	unregister_lte_tty_driver();
-
-	if (mux_rx_wq) {
-		flush_workqueue(mux_rx_wq);
-		destroy_workqueue(mux_rx_wq);
-	}
-
-	usb_deregister(&gdm_mux_driver);
-}
-
-module_init(gdm_usb_mux_init);
-module_exit(gdm_usb_mux_exit);
+module_usb_driver(gdm_mux_driver);
 
 MODULE_DESCRIPTION("GCT LTE TTY Device Driver");
 MODULE_LICENSE("GPL");
-- 
2.1.4



  reply	other threads:[~2015-09-29  4:57 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-29  4:56 [PATCH 1/2] Staging: gdm724x: gdm_usb.c: Use module_usb_driver Shraddha Barke
2015-09-29  4:56 ` Shraddha Barke [this message]
2015-09-29  5:19 ` [Outreachy kernel] " Sudip Mukherjee
2015-09-29  5:48   ` Shraddha Barke
2015-09-29  5:40 ` Julia Lawall
2015-09-29  5:55   ` Shraddha Barke

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=1443502609-9918-2-git-send-email-shraddha.6596@gmail.com \
    --to=shraddha.6596@gmail.com \
    --cc=outreachy-kernel@googlegroups.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.