backports: only add regulator code when regulator is activated in kernel
authorHauke Mehrtens <hauke@hauke-m.de>
Wed, 6 Nov 2013 13:21:14 +0000 (14:21 +0100)
committerHauke Mehrtens <hauke@hauke-m.de>
Thu, 7 Nov 2013 18:47:06 +0000 (19:47 +0100)
The backported parts of the regulator subsystem are depending on the
regulator subsystem being build into the kernel, deactivate them if the
regulator subsystem was not activated in the kernel config.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
backport/compat/backport-3.10.c
backport/compat/backport-3.13.c

index 4d449607187b2cdc74c73ed257dc348057c21456..f44525029e5590353f39f1c0d0787047d3004c99 100644 (file)
@@ -34,6 +34,7 @@
 #endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(3,6,0)) */
 
 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,6,0))
+#ifdef CONFIG_REGULATOR
 /**
  * regulator_map_voltage_ascend - map_voltage() for ascendant voltage list
  *
@@ -65,6 +66,7 @@ int regulator_map_voltage_ascend(struct regulator_dev *rdev,
 }
 EXPORT_SYMBOL_GPL(regulator_map_voltage_ascend);
 
+#endif /* CONFIG_REGULATOR */
 #endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(3,6,0)) */
 
 void proc_set_size(struct proc_dir_entry *de, loff_t size)
index c99625fa467194003a6dbfe251fd4d9b9bb7071d..91fb4804b3fe8d5b58d2e437a7396170a1de2909 100644 (file)
@@ -10,6 +10,7 @@
 #include <linux/version.h>
 
 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0))
+#ifdef CONFIG_REGULATOR
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/regulator/driver.h>
@@ -80,4 +81,5 @@ void devm_regulator_unregister(struct device *dev, struct regulator_dev *rdev)
                WARN_ON(rc);
 }
 EXPORT_SYMBOL_GPL(devm_regulator_unregister);
+#endif /* CONFIG_REGULATOR */
 #endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0)) */