From: Greg Kroah-Hartman Date: Fri, 20 Jul 2012 00:33:09 +0000 (-0700) Subject: Staging: csr: remove oska compat functions X-Git-Tag: v3.6-rc1~100^2~52 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7a72e416e9f44fee263eef4e3c21ac70eb2927dd;p=platform%2Fkernel%2Flinux-3.10.git Staging: csr: remove oska compat functions 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ä Cc: Lauri Hintsala Cc: Riku Mettälä Cc: Veli-Pekka Peltola Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/csr/oska/Makefile b/drivers/staging/csr/oska/Makefile index 3a0b648..57ae66d 100644 --- a/drivers/staging/csr/oska/Makefile +++ b/drivers/staging/csr/oska/Makefile @@ -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 index 790b97a..0000000 --- a/drivers/staging/csr/oska/compat.c +++ /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 . - * 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 index b6d27d3..0000000 --- a/drivers/staging/csr/oska/kernel-compat.h +++ /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 -#include -#include - -#include - -/* - * linux/semaphore.h replaces asm/semaphore.h in 2.6.27. - */ -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,27) -# include -#else -# include -#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 - -#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 - -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 */ diff --git a/drivers/staging/csr/oska/mutex.h b/drivers/staging/csr/oska/mutex.h index 9138b28..e7d46fe 100644 --- a/drivers/staging/csr/oska/mutex.h +++ b/drivers/staging/csr/oska/mutex.h @@ -11,8 +11,8 @@ #include #include +#include -#include "kernel-compat.h" /* Real mutexes were only added to 2.6.16 so use semaphores instead. */