From fe79a8729088b215f6e418d84ffc49a787cbd1b6 Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens Date: Wed, 6 Nov 2013 14:21:14 +0100 Subject: [PATCH] backports: only add regulator code when regulator is activated in kernel 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 --- backport/compat/backport-3.10.c | 2 ++ backport/compat/backport-3.13.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/backport/compat/backport-3.10.c b/backport/compat/backport-3.10.c index 4d449607187b..f44525029e55 100644 --- a/backport/compat/backport-3.10.c +++ b/backport/compat/backport-3.10.c @@ -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) diff --git a/backport/compat/backport-3.13.c b/backport/compat/backport-3.13.c index c99625fa4671..91fb4804b3fe 100644 --- a/backport/compat/backport-3.13.c +++ b/backport/compat/backport-3.13.c @@ -10,6 +10,7 @@ #include #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0)) +#ifdef CONFIG_REGULATOR #include #include #include @@ -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)) */ -- 2.30.2