From 63613d0d387a3b24fab738cbc6c255efb2a0e4f2 Mon Sep 17 00:00:00 2001 From: Guenter Roeck Date: Tue, 27 Mar 2012 08:30:15 -0700 Subject: [PATCH] Add compat.h for backwards compatibility Signed-off-by: Guenter Roeck --- compat.h | 24 ++++++++++++++++++++++++ it87.c | 11 +---------- 2 files changed, 25 insertions(+), 10 deletions(-) create mode 100644 compat.h diff --git a/compat.h b/compat.h new file mode 100644 index 0000000..d512397 --- /dev/null +++ b/compat.h @@ -0,0 +1,24 @@ +/*--------------------------------------------------------------------------- + * + * compat.h + * Copyright (c) 2012 Guenter Roeck + * + *--------------------------------------------------------------------------- + */ + +#ifndef COMPAT_H +#define COMPAT_H + +#ifndef kstrtol +#define kstrtol strict_strtol +#endif +#ifndef kstrtoul +#define kstrtoul strict_strtoul +#endif + +#ifndef request_muxed_region +#define request_muxed_region(a, b, c) (true) +#define release_region(a, b) +#endif + +#endif /* COMPAT_H */ diff --git a/it87.c b/it87.c index a7ff7dc..8cc926a 100644 --- a/it87.c +++ b/it87.c @@ -62,12 +62,7 @@ #include #include -#ifndef kstrtol -#define kstrtol strict_strtol -#endif -#ifndef kstrtoul -#define kstrtoul strict_strtoul -#endif +#include "compat.h" #define DRVNAME "it87" @@ -124,10 +119,8 @@ static inline int superio_enter(void) /* * Try to reserve REG and REG + 1 for exclusive access. */ -#ifdef request_muxed_region if (!request_muxed_region(REG, 2, DRVNAME)) return -EBUSY; -#endif outb(0x87, REG); outb(0x01, REG); @@ -140,9 +133,7 @@ static inline void superio_exit(void) { outb(0x02, REG); outb(0x02, VAL); -#ifdef request_muxed_region release_region(REG, 2); -#endif } /* Logical device 4 registers */ -- 2.39.5