Skip to content

Commit

Permalink
PM / OPP: fix condition for empty of_init_opp_table()
Browse files Browse the repository at this point in the history
randconfig build reports the following error which is caused by
CONFIG_PM_OPP being unset.

  CC      arch/arm/mach-imx/mach-imx6q.o
arch/arm/mach-imx/mach-imx6q.c: In function ‘imx6q_opp_init’:
arch/arm/mach-imx/mach-imx6q.c:248:2: error: implicit declaration of function ‘of_init_opp_table’ [-Werror=implicit-function-declaration]

Fix the error by giving a more correct condition for empty
of_init_opp_table() implementation.

Reported-by: Rob Herring <robherring2@gmail.com>
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Acked-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
  • Loading branch information
Shawn Guo authored and Rafael J. Wysocki committed Feb 22, 2013
1 parent 6be2649 commit d6561bb
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions include/linux/opp.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,6 @@ int opp_enable(struct device *dev, unsigned long freq);
int opp_disable(struct device *dev, unsigned long freq);

struct srcu_notifier_head *opp_get_notifier(struct device *dev);

#ifdef CONFIG_OF
int of_init_opp_table(struct device *dev);
#else
static inline int of_init_opp_table(struct device *dev)
{
return -EINVAL;
}
#endif /* CONFIG_OF */
#else
static inline unsigned long opp_get_voltage(struct opp *opp)
{
Expand Down Expand Up @@ -112,6 +103,15 @@ static inline struct srcu_notifier_head *opp_get_notifier(struct device *dev)
}
#endif /* CONFIG_PM_OPP */

#if defined(CONFIG_PM_OPP) && defined(CONFIG_OF)
int of_init_opp_table(struct device *dev);
#else
static inline int of_init_opp_table(struct device *dev)
{
return -EINVAL;
}
#endif

#if defined(CONFIG_CPU_FREQ) && defined(CONFIG_PM_OPP)
int opp_init_cpufreq_table(struct device *dev,
struct cpufreq_frequency_table **table);
Expand Down

0 comments on commit d6561bb

Please sign in to comment.