summaryrefslogtreecommitdiff
path: root/drivers/dahdi/dahdi-sysfs.h
diff options
context:
space:
mode:
authorTzafrir Cohen <tzafrir.cohen@xorcom.com>2012-03-13 20:09:12 +0000
committerTzafrir Cohen <tzafrir.cohen@xorcom.com>2012-03-13 20:09:12 +0000
commit00a4ff1bd81d8f3774792539cb50712231d72bfe (patch)
treef22e2a9c145d2b8d84a5e21cce25c7e0564636ad /drivers/dahdi/dahdi-sysfs.h
parent950b583f48e117ca3508ef973ad754e6e4b14808 (diff)
Remove support for kernels < 2.6.18
This patch removes support for kernel versions < 2.6.18, as those are not actively supported in any major Linux distribution (except RHEL4, which is in the "extended" support level of the product life cycle). This removes much of the more #ifdef-rich parts of the code. Signed-off-by: Oron Peled <oron.peled@xorcom.com> Acked-by: Acked-by: Shaun Ruffell <sruffell@digium.com> Acked-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com> git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10472 a0bf4364-ded3-4de4-8d8a-66a801d63aff
Diffstat (limited to 'drivers/dahdi/dahdi-sysfs.h')
-rw-r--r--drivers/dahdi/dahdi-sysfs.h55
1 files changed, 2 insertions, 53 deletions
diff --git a/drivers/dahdi/dahdi-sysfs.h b/drivers/dahdi/dahdi-sysfs.h
index 41e1786..9cbd9f9 100644
--- a/drivers/dahdi/dahdi-sysfs.h
+++ b/drivers/dahdi/dahdi-sysfs.h
@@ -1,35 +1,6 @@
#ifndef DAHDI_SYSFS_H
#define DAHDI_SYSFS_H
-/*
- * Very old hotplug support
- */
-#if LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 9)
-#define OLD_HOTPLUG_SUPPORT /* for older kernels */
-#define OLD_HOTPLUG_SUPPORT_269
-#endif
-
-#ifdef OLD_HOTPLUG_SUPPORT_269
-/* Copy from new kernels lib/kobject_uevent.c */
-enum kobject_action {
- KOBJ_ADD,
- KOBJ_REMOVE,
- KOBJ_CHANGE,
- KOBJ_MOUNT,
- KOBJ_UMOUNT,
- KOBJ_OFFLINE,
- KOBJ_ONLINE,
-};
-#endif
-
-/*
- * Hotplug replaced with uevent in 2.6.16
- */
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 16)
-#define OLD_HOTPLUG_SUPPORT /* for older kernels */
-#endif
-
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 14)
#define DEVICE_ATTR_READER(name, dev, buf) \
ssize_t name(struct device *dev, \
struct device_attribute *attr, \
@@ -46,16 +17,6 @@ enum kobject_action {
ssize_t name(struct device *dev, \
struct device_attribute *attr, \
const char *buf, size_t count)
-#else
-#define DEVICE_ATTR_READER(name, dev, buf) \
- ssize_t name(struct device *dev, char *buf)
-#define DEVICE_ATTR_WRITER(name, dev, buf, count) \
- ssize_t name(struct device *dev, const char *buf, size_t count)
-#define BUS_ATTR_READER(name, dev, buf) \
- ssize_t name(struct device *dev, char *buf)
-#define BUS_ATTR_WRITER(name, dev, buf, count) \
- ssize_t name(struct device *dev, const char *buf, size_t count)
-#endif
#define DRIVER_ATTR_READER(name, drv, buf) \
ssize_t name(struct device_driver *drv, char * buf)
@@ -68,15 +29,9 @@ enum kobject_action {
#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 26)
#define CLASS_DEV_CREATE(class, devt, device, name) \
device_create(class, device, devt, name)
-#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 15)
-#define CLASS_DEV_CREATE(class, devt, device, name) \
- class_device_create(class, NULL, devt, device, name)
-#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 13)
-#define CLASS_DEV_CREATE(class, devt, device, name) \
- class_device_create(class, devt, device, name)
#else
#define CLASS_DEV_CREATE(class, devt, device, name) \
- class_simple_device_add(class, devt, device, name)
+ class_device_create(class, NULL, devt, device, name)
#endif
/* Device file destruction macros */
@@ -84,15 +39,9 @@ enum kobject_action {
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 26)
#define CLASS_DEV_DESTROY(class, devt) \
device_destroy(class, devt)
-#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 13)
-#define CLASS_DEV_DESTROY(class, devt) \
- class_device_destroy(class, devt)
-#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 9)
-#define CLASS_DEV_DESTROY(class, devt) \
- class_simple_device_remove(devt)
#else
#define CLASS_DEV_DESTROY(class, devt) \
- class_simple_device_remove(class, devt)
+ class_device_destroy(class, devt)
#endif
/* Global */