]> git.sur5r.net Git - groeck-it87/commitdiff
Declare dummy vid functions if needed
authorGuenter Roeck <linux@roeck-us.net>
Wed, 24 May 2017 13:02:47 +0000 (06:02 -0700)
committerGuenter Roeck <linux@roeck-us.net>
Wed, 24 May 2017 13:02:47 +0000 (06:02 -0700)
Some kernel configurations may have CONFIG_HWMON_VID disabled.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
compat.h

index 29ccdb7f3ece2eb6aa532c5dd71dea8a02be9d6a..865dcc520caec6b6b858363d8f621eb84231afcc 100644 (file)
--- a/compat.h
+++ b/compat.h
@@ -44,8 +44,25 @@ static inline int strict_strtol(const char *cp, unsigned int base, long *res)
 #endif
 
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 39)
 #endif
 
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 39)
-#define kstrtoul strict_strtoul
+#define kstrtoul strict_strtoul 
 #define kstrtol strict_strtol
 #endif
 
 #define kstrtol strict_strtol
 #endif
 
+/*
+ * Some kernel configurations may have CONFIG_HWMON_VID disabled.
+ * We still have the functios declared as external, so we can not use
+ * static inline.
+ */
+#if !defined(CONFIG_HWMON_VID) && !defined(CONFIG_HWMON_VID_MODULE)
+int vid_from_reg(int val, u8 vrm)
+{
+       return 0;
+}
+
+u8 vid_which_vrm(void)
+{
+       return 0;
+}
+#endif
+
 #endif /* COMPAT_H */
 #endif /* COMPAT_H */