All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Tobin C. Harding" <me@tobin.cc>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Wolfram Sang <wsa@the-dreams.de>, driverdev-devel@linuxdriverproject.org
Subject: [PATCH 06/15] staging: ks7010: move tasklet_struct to ks_wlan_private
Date: Tue, 18 Apr 2017 10:35:34 +1000	[thread overview]
Message-ID: <1492475743-25189-7-git-send-email-me@tobin.cc> (raw)
In-Reply-To: <1492475743-25189-1-git-send-email-me@tobin.cc>

Currently a pointer to the tasklet_struct used for bottom half
processing on the receive path is within the hw_info_t structure. This
structure is then embedded in the device private data
structure. Having the tasklet_struct nested does not add meaning to
the device private data, device private data already (and typically)
has various data relating to the device, there is no real need to
separate the tasklet_struct to a SDIO specific structure. While not
adding allot of extra meaning having the nested structure means the
programmer must open two header files to read the description of the
device private data, the code would be easier to read if the device
private data struct description was not spread over two files.

Move tasklet_struct out of sdio header file and into the device
private data structure description.

Signed-off-by: Tobin C. Harding <me@tobin.cc>
---
 drivers/staging/ks7010/ks7010_sdio.c | 10 ++++------
 drivers/staging/ks7010/ks7010_sdio.h |  1 -
 drivers/staging/ks7010/ks_wlan.h     |  1 +
 3 files changed, 5 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/ks7010/ks7010_sdio.c b/drivers/staging/ks7010/ks7010_sdio.c
index 0f173c3..2d73ebb 100644
--- a/drivers/staging/ks7010/ks7010_sdio.c
+++ b/drivers/staging/ks7010/ks7010_sdio.c
@@ -380,7 +380,7 @@ static void rx_event_task(unsigned long dev)
 		inc_rxqhead(priv);
 
 		if (cnt_rxqbody(priv) > 0)
-			tasklet_schedule(&priv->ks_wlan_hw.rx_bh_task);
+			tasklet_schedule(&priv->rx_bh_task);
 	}
 }
 
@@ -447,8 +447,7 @@ static void ks_wlan_hw_rx(struct ks_wlan_private *priv, uint16_t size)
 		}
 	}
 
-	/* rx_event_task((void *)priv); */
-	tasklet_schedule(&priv->ks_wlan_hw.rx_bh_task);
+	tasklet_schedule(&priv->rx_bh_task);
 }
 
 static void ks7010_rw_function(struct work_struct *work)
@@ -614,8 +613,7 @@ static int trx_device_init(struct ks_wlan_private *priv)
 	spin_lock_init(&priv->tx_dev.tx_dev_lock);
 	spin_lock_init(&priv->rx_dev.rx_dev_lock);
 
-	tasklet_init(&priv->ks_wlan_hw.rx_bh_task, rx_event_task,
-		     (unsigned long)priv);
+	tasklet_init(&priv->rx_bh_task, rx_event_task, (unsigned long)priv);
 
 	return 0;
 }
@@ -633,7 +631,7 @@ static void trx_device_exit(struct ks_wlan_private *priv)
 		inc_txqhead(priv);
 	}
 
-	tasklet_kill(&priv->ks_wlan_hw.rx_bh_task);
+	tasklet_kill(&priv->rx_bh_task);
 }
 
 static int ks7010_sdio_update_index(struct ks_wlan_private *priv, u32 index)
diff --git a/drivers/staging/ks7010/ks7010_sdio.h b/drivers/staging/ks7010/ks7010_sdio.h
index d04fccc..76c6b102 100644
--- a/drivers/staging/ks7010/ks7010_sdio.h
+++ b/drivers/staging/ks7010/ks7010_sdio.h
@@ -89,7 +89,6 @@ struct hw_info_t {
 	struct ks_sdio_card *sdio_card;
 	struct workqueue_struct *ks7010sdio_wq;
 	struct delayed_work rw_wq;
-	struct tasklet_struct rx_bh_task;
 };
 
 struct ks_sdio_card {
diff --git a/drivers/staging/ks7010/ks_wlan.h b/drivers/staging/ks7010/ks_wlan.h
index 7968470..b0bc7a8 100644
--- a/drivers/staging/ks7010/ks_wlan.h
+++ b/drivers/staging/ks7010/ks_wlan.h
@@ -414,6 +414,7 @@ struct wps_status_t {
 
 struct ks_wlan_private {
 	struct hw_info_t ks_wlan_hw;	/* hardware information */
+	struct tasklet_struct rx_bh_task;
 
 	struct net_device *net_dev;
 	int reg_net;	/* register_netdev */
-- 
2.7.4

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

  parent reply	other threads:[~2017-04-18  0:36 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-18  0:35 [PATCH 00/15] staging: ks7010: refactor SDIO code Tobin C. Harding
2017-04-18  0:35 ` [PATCH 01/15] staging: ks7010: create reg_status_type enum type Tobin C. Harding
2017-04-18  0:35 ` [PATCH 02/15] staging: ks7010: replace defines with enum types Tobin C. Harding
2017-04-18  0:35 ` [PATCH 03/15] staging: ks7010: fix complete_handler Tobin C. Harding
2017-04-18  0:35 ` [PATCH 04/15] staging: ks7010: clean up SDIO header comments Tobin C. Harding
2017-04-18  0:35 ` [PATCH 05/15] staging: ks7010: rename wakeup work struct Tobin C. Harding
2017-04-18  0:35 ` Tobin C. Harding [this message]
2017-04-18  0:35 ` [PATCH 07/15] staging: ks7010: move hw info into dev private data Tobin C. Harding
2017-04-18  0:35 ` [PATCH 08/15] staging: ks7010: add struct comment to ks_sdio_card Tobin C. Harding
2017-04-18  0:35 ` [PATCH 09/15] staging: ks7010: clean up SDIO source comments Tobin C. Harding
2017-04-18  0:35 ` [PATCH 10/15] staging: ks7010: remove err_ from non-error path label Tobin C. Harding
2017-04-18  0:35 ` [PATCH 11/15] staging: ks7010: fix checkpatch SPACE_BEFORE_TAB Tobin C. Harding
2017-04-18  0:35 ` [PATCH 12/15] staging: ks7010: fix checkpatch LINE_SPACING Tobin C. Harding
2017-04-18  0:35 ` [PATCH 13/15] staging: ks7010: refactor SDIO read/write helpers Tobin C. Harding
2017-04-18  0:35 ` [PATCH 14/15] staging: ks7010: fix checkpatch SPLIT_STRING Tobin C. Harding
2017-04-18  0:35 ` [PATCH 15/15] staging: ks7010: rename SDIO files Tobin C. Harding
2017-04-18 11:47   ` Greg Kroah-Hartman

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=1492475743-25189-7-git-send-email-me@tobin.cc \
    --to=me@tobin.cc \
    --cc=driverdev-devel@linuxdriverproject.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=wsa@the-dreams.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 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.