From: Hauke Mehrtens Date: Wed, 6 Nov 2013 13:21:14 +0000 (+0100) Subject: backports: only add regulator code when regulator is activated in kernel X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=fe79a8729088b215f6e418d84ffc49a787cbd1b6;p=openwrt%2Fstaging%2Fblogic.git 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 --- 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)) */