staging: wilc1000: simplify semaphore wrapper
authorArnd Bergmann <arnd@arndb.de>
Mon, 1 Jun 2015 19:06:38 +0000 (21:06 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 2 Jun 2015 04:45:22 +0000 (13:45 +0900)
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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/wilc1000/wilc_osconfig.h
drivers/staging/wilc1000/wilc_oswrapper.h
drivers/staging/wilc1000/wilc_semaphore.c
drivers/staging/wilc1000/wilc_semaphore.h

index eec93b351f147dd3a5e9f274235973b8379be4e2..d0bf08f89906d79588b7ee6c678d8fe1bb6f1776 100644 (file)
@@ -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
index fd5dd3c6316e11064310d260346d849e907b5a08..32fe48a6034b0d3d7c1b048c6767861282dc9e8e 100644 (file)
@@ -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
index 637107bfb877204582066fd1d18b1a33f3f05967..f09a88ca6ae44b916ca01795d871098517f64758 100644 (file)
@@ -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
index 3006f9f20c4d11ab400aee036129656f89d3c94d..3c0ecc326fb382a737917d5258c52d06a4d07a5e 100644 (file)
  *  @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