linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Priit Laes <plaes@plaes.org>
To: linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Priit Laes <plaes@plaes.org>
Subject: [PATCH 10/14] staging: csr: drv.c: Remove KERNEL_VERSION checks and associated defines
Date: Sat,  1 Sep 2012 12:06:06 +0300	[thread overview]
Message-ID: <1346490370-32438-11-git-send-email-plaes@plaes.org> (raw)
In-Reply-To: <1346490370-32438-1-git-send-email-plaes@plaes.org>


Signed-off-by: Priit Laes <plaes@plaes.org>
---
 drivers/staging/csr/drv.c | 43 ++++++++-----------------------------------
 1 file changed, 8 insertions(+), 35 deletions(-)

diff --git a/drivers/staging/csr/drv.c b/drivers/staging/csr/drv.c
index b2c27f4..4f7fe52 100644
--- a/drivers/staging/csr/drv.c
+++ b/drivers/staging/csr/drv.c
@@ -124,11 +124,7 @@ static void udi_set_log_filter(ul_client_t *pcli,
 
 
 /* Mutex to protect access to  priv->sme_cli */
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 37)
 DEFINE_SEMAPHORE(udi_mutex);
-#else
-DECLARE_MUTEX(udi_mutex);
-#endif
 
 s32 CsrHipResultToStatus(CsrResult csrResult)
 {
@@ -1980,18 +1976,6 @@ uf_sme_queue_message(unifi_priv_t *priv, u8 *buffer, int length)
 } /* uf_sme_queue_message() */
 #endif
 
-
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27)
-#define UF_DEVICE_CREATE(_class, _parent, _devno, _priv, _fmt, _args)       \
-    device_create(_class, _parent, _devno, _priv, _fmt, _args)
-#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,26)
-#define UF_DEVICE_CREATE(_class, _parent, _devno, _priv, _fmt, _args)       \
-    device_create_drvdata(_class, _parent, _devno, _priv, _fmt, _args)
-#else
-#define UF_DEVICE_CREATE(_class, _parent, _devno, _priv, _fmt, _args)       \
-    device_create(_class, _parent, _devno, _fmt, _args)
-#endif
-
 /*
  ****************************************************************************
  *
@@ -2009,17 +1993,6 @@ static struct file_operations unifi_fops = {
     .poll       = unifi_poll,
 };
 
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27)
-#define UF_DEVICE_CREATE(_class, _parent, _devno, _priv, _fmt, _args)       \
-    device_create(_class, _parent, _devno, _priv, _fmt, _args)
-#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,26)
-#define UF_DEVICE_CREATE(_class, _parent, _devno, _priv, _fmt, _args)       \
-    device_create_drvdata(_class, _parent, _devno, _priv, _fmt, _args)
-#else
-#define UF_DEVICE_CREATE(_class, _parent, _devno, _priv, _fmt, _args)       \
-    device_create(_class, _parent, _devno, _fmt, _args)
-#endif
-
 static dev_t unifi_first_devno;
 static struct class *unifi_class;
 
@@ -2042,11 +2015,11 @@ int uf_create_device_nodes(unifi_priv_t *priv, int bus_id)
     }
 
 #ifdef SDIO_EXPORTS_STRUCT_DEVICE
-    if (!UF_DEVICE_CREATE(unifi_class, priv->unifi_device,
-                          devno, priv, "unifi%d", bus_id)) {
+    if (!device_create(unifi_class, priv->unifi_device,
+                       devno, priv, "unifi%d", bus_id)) {
 #else
-    priv->unifi_device = UF_DEVICE_CREATE(unifi_class, NULL,
-                                          devno, priv, "unifi%d", bus_id);
+    priv->unifi_device = device_create(unifi_class, NULL,
+                                       devno, priv, "unifi%d", bus_id);
     if (priv->unifi_device == NULL) {
 #endif /* SDIO_EXPORTS_STRUCT_DEVICE */
 
@@ -2068,13 +2041,13 @@ int uf_create_device_nodes(unifi_priv_t *priv, int bus_id)
         return r;
     }
 
-    if (!UF_DEVICE_CREATE(unifi_class,
+    if (!device_create(unifi_class,
 #ifdef SDIO_EXPORTS_STRUCT_DEVICE
-                          priv->unifi_device,
+                       priv->unifi_device,
 #else
-                          NULL,
+                       NULL,
 #endif /* SDIO_EXPORTS_STRUCT_DEVICE */
-                          devno, priv, "unifiudi%d", bus_id)) {
+                       devno, priv, "unifiudi%d", bus_id)) {
         device_destroy(unifi_class, priv->unifi_cdev.dev);
         cdev_del(&priv->unifiudi_cdev);
         cdev_del(&priv->unifi_cdev);
-- 
1.7.12


  parent reply	other threads:[~2012-09-01  9:17 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-01  9:05 [PATCH 00/14] staging: csr: Remove kernel version checks Priit Laes
2012-09-01  9:05 ` [PATCH 01/14] staging: csr: netdev.c: Clean up KERNEL_VERSION checks: <=2.6.25 Priit Laes
2012-09-01  9:05 ` [PATCH 02/14] staging: csr: netdev.c: Clean up KERNEL_VERSION checks: 2.6.27 Priit Laes
2012-09-01  9:05 ` [PATCH 03/14] staging: csr: netdev.c: Clean up KERNEL_VERSION checks: 2.6.28 Priit Laes
2012-09-01  9:06 ` [PATCH 04/14] staging: csr: netdev.c: Clean up KERNEL_VERSION checks: 2.6.29 Priit Laes
2012-09-01  9:06 ` [PATCH 05/14] staging: csr: netdev.c: Clean up KERNEL_VERSION checks: 2.6.32 Priit Laes
2012-09-01  9:06 ` [PATCH 06/14] staging: csr: netdev.c: Clean up KERNEL_VERSION checks: 2.6.34 Priit Laes
2012-09-01  9:06 ` [PATCH 07/14] staging: csr: netdev.c: Clean up KERNEL_VERSION checks: 2.6.37 Priit Laes
2012-09-01  9:06 ` [PATCH 08/14] staging: csr: remove unused define ALLOW_Q_PAUSE Priit Laes
2012-09-01  9:06 ` [PATCH 09/14] staging: csr: Drop unused UNIFI_NET_NAME configuration option Priit Laes
2012-09-01  9:06 ` Priit Laes [this message]
2012-09-01  9:06 ` [PATCH 11/14] staging: csr: unifi_wext.h: Remove KERNEL_VERSION checks Priit Laes
2012-09-01  9:06 ` [PATCH 12/14] staging: csr: unifi_priv.h: " Priit Laes
2012-09-01  9:06 ` [PATCH 13/14] staging: csr: Remove unneeded UF_NETIF_TX_* macros Priit Laes
2012-09-01  9:06 ` [PATCH 14/14] staging: csr: Remove all leftover kernel version checks \o/ Priit Laes

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=1346490370-32438-11-git-send-email-plaes@plaes.org \
    --to=plaes@plaes.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    /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).