From: Arnd Bergmann <arnd@arndb.de>
To: Greg KH <gregkh@linuxfoundation.org>
Cc: Rachel Kim <rachel.kim@atmel.com>, Dean Lee <dean.lee@atmel.com>,
Chris Park <chris.park@atmel.com>,
devel@driverdev.osuosl.org, nicolas.ferre@atmel.com,
Johnny Kim <johnny.kim@atmel.com>,
linux-kernel@vger.kernel.org, Arnd Bergmann <arnd@arndb.de>
Subject: [PATCH 09/16] staging: wilc1000: simplify semaphore wrapper
Date: Fri, 29 May 2015 22:52:20 +0200 [thread overview]
Message-ID: <1432932747-3739705-10-git-send-email-arnd@arndb.de> (raw)
In-Reply-To: <1432932747-3739705-1-git-send-email-arnd@arndb.de>
The driver has its own API for semaphores. This should
be replaced with mutexes and completions, but for the moment
we can start by removing the obviously unused parts.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
drivers/staging/wilc1000/wilc_osconfig.h | 1 -
drivers/staging/wilc1000/wilc_oswrapper.h | 2 --
drivers/staging/wilc1000/wilc_semaphore.c | 14 --------------
drivers/staging/wilc1000/wilc_semaphore.h | 18 +-----------------
4 files changed, 1 insertion(+), 34 deletions(-)
diff --git a/drivers/staging/wilc1000/wilc_osconfig.h b/drivers/staging/wilc1000/wilc_osconfig.h
index eec93b351f14..d0bf08f89906 100644
--- a/drivers/staging/wilc1000/wilc_osconfig.h
+++ b/drivers/staging/wilc1000/wilc_osconfig.h
@@ -10,7 +10,6 @@
/* OS features supported */
-#define CONFIG_WILC_SEMAPHORE_FEATURE 1
/* #define CONFIG_WILC_SEMAPHORE_TIMEOUT 1 */
#define CONFIG_WILC_SLEEP_FEATURE 1
#define CONFIG_WILC_SLEEP_HI_RES 1
diff --git a/drivers/staging/wilc1000/wilc_oswrapper.h b/drivers/staging/wilc1000/wilc_oswrapper.h
index fd5dd3c6316e..32fe48a6034b 100644
--- a/drivers/staging/wilc1000/wilc_oswrapper.h
+++ b/drivers/staging/wilc1000/wilc_oswrapper.h
@@ -55,9 +55,7 @@ typedef WILC_Uint16 WILC_WideChar;
#include "wilc_errorsupport.h"
/* Semaphore support */
-#ifdef CONFIG_WILC_SEMAPHORE_FEATURE
#include "wilc_semaphore.h"
-#endif
/* Sleep support */
#ifdef CONFIG_WILC_SLEEP_FEATURE
diff --git a/drivers/staging/wilc1000/wilc_semaphore.c b/drivers/staging/wilc1000/wilc_semaphore.c
index 637107bfb877..f09a88ca6ae4 100644
--- a/drivers/staging/wilc1000/wilc_semaphore.c
+++ b/drivers/staging/wilc1000/wilc_semaphore.c
@@ -1,7 +1,5 @@
#include "wilc_oswrapper.h"
-#ifdef CONFIG_WILC_SEMAPHORE_FEATURE
-
WILC_ErrNo WILC_SemaphoreCreate(WILC_SemaphoreHandle *pHandle,
tstrWILC_SemaphoreAttrs *pstrAttrs)
@@ -33,19 +31,9 @@ WILC_ErrNo WILC_SemaphoreAcquire(WILC_SemaphoreHandle *pHandle,
{
WILC_ErrNo s32RetStatus = WILC_SUCCESS;
- #ifndef CONFIG_WILC_SEMAPHORE_TIMEOUT
while (down_interruptible(pHandle))
;
- #else
- if (pstrAttrs == WILC_NULL) {
- down(pHandle);
- } else {
-
- s32RetStatus = down_timeout(pHandle, msecs_to_jiffies(pstrAttrs->u32TimeOut));
- }
- #endif
-
if (s32RetStatus == 0) {
return WILC_SUCCESS;
} else if (s32RetStatus == -ETIME) {
@@ -66,5 +54,3 @@ WILC_ErrNo WILC_SemaphoreRelease(WILC_SemaphoreHandle *pHandle,
return WILC_SUCCESS;
}
-
-#endif
diff --git a/drivers/staging/wilc1000/wilc_semaphore.h b/drivers/staging/wilc1000/wilc_semaphore.h
index 3006f9f20c4d..3c0ecc326fb3 100644
--- a/drivers/staging/wilc1000/wilc_semaphore.h
+++ b/drivers/staging/wilc1000/wilc_semaphore.h
@@ -10,11 +10,6 @@
* @version 1.0
*/
-
-#ifndef CONFIG_WILC_SEMAPHORE_FEATURE
-#error the feature WILC_OS_FEATURE_SEMAPHORE must be supported to include this file
-#endif
-
/*!
* @struct WILC_SemaphoreAttrs
* @brief Semaphore API options
@@ -28,14 +23,6 @@ typedef struct {
*/
WILC_Uint32 u32InitCount;
- #ifdef CONFIG_WILC_SEMAPHORE_TIMEOUT
- /*!<
- * Timeout for use with WILC_SemaphoreAcquire, 0 to return immediately and
- * WILC_OS_INFINITY to wait forever. default is WILC_OS_INFINITY
- */
- WILC_Uint32 u32TimeOut;
- #endif
-
} tstrWILC_SemaphoreAttrs;
@@ -47,12 +34,9 @@ typedef struct {
* @date 10 Aug 2010
* @version 1.0
*/
-static void WILC_SemaphoreFillDefault(tstrWILC_SemaphoreAttrs *pstrAttrs)
+static inline void WILC_SemaphoreFillDefault(tstrWILC_SemaphoreAttrs *pstrAttrs)
{
pstrAttrs->u32InitCount = 1;
- #ifdef CONFIG_WILC_SEMAPHORE_TIMEOUT
- pstrAttrs->u32TimeOut = WILC_OS_INFINITY;
- #endif
}
/*!
* @brief Creates a new Semaphore object
--
2.1.0.rc2
next prev parent reply other threads:[~2015-05-29 20:55 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-29 20:52 [PATCH 00/16] wilc1000: dead code removal and other cleanup Arnd Bergmann
2015-05-29 20:52 ` [PATCH 01/16] staging: wilc1000: remove linux version checks Arnd Bergmann
2015-05-29 20:52 ` [PATCH 02/16] staging: wilc1000: remove platform " Arnd Bergmann
2015-05-29 20:52 ` [PATCH 03/16] staging: wilc1000: remove thread wrapper Arnd Bergmann
2015-05-29 20:52 ` [PATCH 04/16] staging: wilc1000: remove __DRIVER_VERSION__ macro Arnd Bergmann
2015-05-29 20:52 ` [PATCH 05/16] staging: wilc1000: remove time wrapper Arnd Bergmann
2015-05-30 6:39 ` Sudip Mukherjee
2015-05-30 23:58 ` Greg KH
2015-06-01 19:09 ` Arnd Bergmann
2015-05-29 20:52 ` [PATCH 06/16] staging: wilc1000: remove unused string functions Arnd Bergmann
2015-05-29 20:52 ` [PATCH 07/16] staging: wilc1000: simplify msgqueue code Arnd Bergmann
2015-05-29 20:52 ` [PATCH 08/16] staging: wilc1000: remove unused memory handling code Arnd Bergmann
2015-05-29 20:52 ` Arnd Bergmann [this message]
2015-05-29 20:52 ` [PATCH 10/16] staging: wilc1000: clean up sleep wrapper Arnd Bergmann
2015-05-29 20:52 ` [PATCH 11/16] staging: wilc1000: clean up timer feature Arnd Bergmann
2015-05-29 20:52 ` [PATCH 12/16] staging: wilc1000: remove unused OS abstraction features Arnd Bergmann
2015-05-29 20:52 ` [PATCH 13/16] staging: wilc1000: remove EXPORT_SYMTAB Arnd Bergmann
2015-05-29 20:52 ` [PATCH 14/16] staging: wilc1000: remove semaphore wrapper Arnd Bergmann
2015-05-30 6:46 ` Sudip Mukherjee
2015-05-29 20:52 ` [PATCH 15/16] staging: wilc1000: fix const cast warnings Arnd Bergmann
2015-05-29 20:52 ` [PATCH 16/16] staging: wilc1000: fix compiler warnings Arnd Bergmann
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=1432932747-3739705-10-git-send-email-arnd@arndb.de \
--to=arnd@arndb.de \
--cc=chris.park@atmel.com \
--cc=dean.lee@atmel.com \
--cc=devel@driverdev.osuosl.org \
--cc=gregkh@linuxfoundation.org \
--cc=johnny.kim@atmel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=nicolas.ferre@atmel.com \
--cc=rachel.kim@atmel.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
all inboxes | Powered by JetHome®