Staging: csr: remove oska compat functions
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 20 Jul 2012 00:33:09 +0000 (17:33 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 20 Jul 2012 00:33:09 +0000 (17:33 -0700)
These functions were for older kernel versions, which we aren't
supporting anymore now that this is in the kernel.  So remove the files,
they are no longer needed.

Cc: Mikko Virkkilä <mikko.virkkila@bluegiga.com>
Cc: Lauri Hintsala <Lauri.Hintsala@bluegiga.com>
Cc: Riku Mettälä <riku.mettala@bluegiga.com>
Cc: Veli-Pekka Peltola <veli-pekka.peltola@bluegiga.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/csr/oska/Makefile
drivers/staging/csr/oska/compat.c [deleted file]
drivers/staging/csr/oska/kernel-compat.h [deleted file]
drivers/staging/csr/oska/mutex.h

index 3a0b648ddebc3d728d52115be548d6b8f1f17648..57ae66d874913500530b2820c571c8fb9110bd4e 100644 (file)
@@ -3,7 +3,6 @@ obj-$(CONFIG_CSR_WIFI) := csr_oska.o
 csr_oska-y := \
        list.o \
        refcount.o \
-       compat.o \
        event.o \
        oska_module.o \
        print.o  \
diff --git a/drivers/staging/csr/oska/compat.c b/drivers/staging/csr/oska/compat.c
deleted file mode 100644 (file)
index 790b97a..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Linux version compatibility functions.
- *
- * Copyright (C) 2008 Cambridge Silicon Radio Ltd.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License version
- * 2 as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
- * Refer to LICENSE.txt included with this source code for details on
- * the license terms.
- */
-#include "kernel-compat.h"
-
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,26)
-
-int dev_set_name(struct device *dev, const char *fmt, ...)
-{
-    va_list vargs;
-
-    va_start(vargs, fmt);
-    vsnprintf(dev->bus_id, sizeof(dev->bus_id), fmt, vargs);
-    va_end(vargs);
-    return 0;
-}
-EXPORT_SYMBOL_GPL(dev_set_name);
-
-#endif /* Linux kernel < 2.6.26 */
-
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,25)
-
-struct device *class_find_device(struct class *class, struct device *start,
-                                 void *data, int (*match)(struct device *, void *))
-{
-    struct device *dev;
-
-    list_for_each_entry(dev, &class->devices, node) {
-        if (match(dev, data)) {
-            get_device(dev);
-            return dev;
-        }
-    }
-    return NULL;
-}
-EXPORT_SYMBOL_GPL(class_find_device);
-
-#endif /* Linux kernel < 2.6.25 */
diff --git a/drivers/staging/csr/oska/kernel-compat.h b/drivers/staging/csr/oska/kernel-compat.h
deleted file mode 100644 (file)
index b6d27d3..0000000
+++ /dev/null
@@ -1,199 +0,0 @@
-/*
- * Kernel version compatibility.
- *
- * Copyright (C) 2007-2008 Cambridge Silicon Radio Ltd.
- *
- * Refer to LICENSE.txt included with this source code for details on
- * the license terms.
- *
- * Wherever possible compatible implementations of newer APIs are
- * provided for older kernel versions.
- */
-#ifndef __LINUX_KERNEL_COMPAT_H
-#define __LINUX_KERNEL_COMPAT_H
-
-#include <linux/version.h>
-#include <linux/device.h>
-#include <linux/workqueue.h>
-
-#include <asm/io.h>
-
-/*
- * linux/semaphore.h replaces asm/semaphore.h in 2.6.27.
- */
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,27)
-#  include <asm/semaphore.h>
-#else
-#  include <linux/semaphore.h>
-#endif
-
-/*
- * Workqueue API changes in 2.6.20
- *
- * See http://lwn.net/Articles/211279/ for details.
- *
- * We deliberately don't provide the non-automatic release (NAR)
- * variants as a simple compatible implementation is not possible.
- * This shouldn't be a problem as all usage so far is to embed the
- * struct work_struct into another struct and the NAR variants aren't
- * useful in this case (see http://lwn.net/Articles/213149/).
- */
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20)
-
-#include <linux/workqueue.h>
-
-#undef INIT_WORK
-#define INIT_WORK(_work, _func)                                         \
-    do {                                                                \
-        INIT_LIST_HEAD(&(_work)->entry);                                \
-        (_work)->pending = 0;                                           \
-        PREPARE_WORK((_work), (_func), (_work));                        \
-        init_timer(&(_work)->timer);                                    \
-    } while(0)
-
-#undef DECLARE_WORK
-#define DECLARE_WORK(n, f) \
-    struct work_struct n = __WORK_INITIALIZER((n), (f), &(n))
-
-struct delayed_work {
-    struct work_struct work;
-};
-
-#define INIT_DELAYED_WORK(dw, fn) \
-    INIT_WORK(&(dw)->work, (fn))
-
-#define queue_delayed_work(wq, dw, delay) \
-    queue_delayed_work((wq), &(dw)->work, (delay))
-
-#define schedule_delayed_work(dw, delay) \
-    schedule_delayed_work(&(dw)->work, (delay))
-
-#define cancel_delayed_work(dw) \
-    cancel_delayed_work(&(dw)->work)
-
-#endif  /* Linux kernel < 2.6.20 */
-
-/*
- * device_create()/class_device_create()
- *
- * device_create() gains a drvdata parameter in 2.6.27. Since all
- * users of device_create() in CSR code don't use drvdata just ignore
- * it.
- *
- * device_create() replaces class_device_create() in 2.6.21.
- */
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,21)
-
-#define device_create(class, parent, devt, drvdata, fmt, args...) \
-    class_device_create((class), (parent), (devt), NULL, (fmt), ## args)
-#define device_destroy(class, devt) \
-    class_device_destroy(class, devt)
-
-#elif LINUX_VERSION_CODE < KERNEL_VERSION(2,6,27)
-
-#define device_create(class, parent, devt, drvdata, fmt, args...) \
-    device_create((class), (parent), (devt), (fmt), ## args)
-
-#endif /* Linux kernel < 2.6.26 */
-
-/*
- * dev_name() and dev_set_name() added in 2.6.26.
- */
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,26)
-
-static inline char *dev_name(struct device *dev)
-{
-    return dev->bus_id;
-}
-
-int dev_set_name(struct device *dev, const char *fmt, ...);
-
-#endif /* Linux kernel < 2.6.26 */
-
-/*
- * class_find_device() in 2.6.25
- */
-
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,25)
-
-struct device *class_find_device(struct class *class, struct device *start,
-                                 void *data, int (*match)(struct device *, void *));
-
-#endif /* Linux kernel < 2.6.25 */
-
-/*
- * list_first_entry in 2.6.22.
- */
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,22)
-
-#define list_first_entry(ptr, type, member) \
-    list_entry((ptr)->next, type, member)
-
-#endif /* Linux kernel < 2.6.22 */
-
-/*
- * 2.6.19 adds a bool type.
- */
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19)
-
-typedef _Bool bool;
-enum {
-        false   = 0,
-        true    = 1
-};
-
-#endif /* Linux kernel < 2.6.19 */
-
-/*
- * Provide readq() and writeq() if unavailable.
- */
-#ifndef readq
-static inline __u64 readq(const volatile void __iomem *addr)
-{
-    const volatile u32 __iomem *p = addr;
-    u32 low, high;
-
-    low = readl(p);
-    high = readl(p + 1);
-
-    return low + ((u64)high << 32);
-}
-#endif
-
-#ifndef writeq
-static inline void writeq(__u64 val, volatile void __iomem *addr)
-{
-    writel(val, addr);
-    writel(val >> 32, addr+4);
-}
-#endif
-
-/*
- * get_unaligned_le16() and friends added in 2.6.26.
- */
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,26)
-#include <asm/unaligned.h>
-
-static inline __u16 get_unaligned_le16(const void *p)
-{
-    return le16_to_cpu(get_unaligned((__le16 *)p));
-}
-
-static inline void put_unaligned_le16(__u16 val, const void *p)
-{
-    put_unaligned(cpu_to_le16(val), (__le16 *)p);
-}
-#endif /* Linux kernel < 2.6.26 */
-
-/*
- * Various device or vendor IDs may not exist.
- */
-#ifndef PCI_VENDOR_ID_CSR
-#  define PCI_VENDOR_ID_CSR 0x18e5
-#endif
-
-#ifndef PCI_DEVICE_ID_JMICRON_JMB38X_SD
-#  define PCI_DEVICE_ID_JMICRON_JMB38X_SD 0x2381
-#endif
-
-#endif /* #ifndef __LINUX_KERNEL_COMPAT_H */
index 9138b288183287dfa349ab8e8f758880cbc85146..e7d46fe9af025f1167fb398db9cd3c68bfb90392 100644 (file)
@@ -11,8 +11,8 @@
 
 #include <linux/kernel.h>
 #include <linux/mutex.h>
+#include <linux/semaphore.h>
 
-#include "kernel-compat.h"
 
 /* Real mutexes were only added to 2.6.16 so use semaphores
    instead. */