1 /*---------------------------------------------------------------------------
4 * Copyright (c) 2012 Guenter Roeck <linux@roeck-us.net>
6 *---------------------------------------------------------------------------
12 #include <linux/version.h>
15 #define clamp_val SENSORS_LIMIT
18 #ifndef request_muxed_region
19 #if LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 28)
20 #define request_muxed_region(start,n,name) __request_region(&ioport_resource, (start), (n), (name))
22 #define IORESOURCE_MUXED 0x00400000
23 #define request_muxed_region(start,n,name) __request_region(&ioport_resource, (start), (n), (name), IORESOURCE_MUXED)
27 /* Red Hat EL5 includes backports of these functions, so we can't redefine
29 #if LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 24)
30 #if !(defined RHEL_MAJOR && RHEL_MAJOR == 5 && RHEL_MINOR >= 5)
31 static inline int strict_strtoul(const char *cp, unsigned int base,
34 *res = simple_strtoul(cp, NULL, base);
38 static inline int strict_strtol(const char *cp, unsigned int base, long *res)
40 *res = simple_strtol(cp, NULL, base);
46 #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 39)
47 #define kstrtoul strict_strtoul
48 #define kstrtol strict_strtol