Skip to contentSkip to conversation

PM / OPP: fix condition for empty of_init_opp_table()

PATCH New Shawn Guo 3 participants 3 messages Feb 21, 2013

lore
Share & tools
lore

Shawn Guo

author
#0 lore raw

PATCH 1/1 PM / OPP: fix condition for empty of_init_opp_table()

randconfig build reports the following error which is caused by that CONFIG_PM_OPP is 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.

---
 include/linux/opp.h |   18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)
include/linux/opp.h +9 -9
index 214e0eb..3aca2b8 100644
@@ -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)
 {
@@ -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);
Signature · 1 line
1.7.9.5
#1 lore raw

PATCH 1/1 PM / OPP: fix condition for empty of_init_opp_table()

Quoted 3 lines · Shawn Guo

randconfig build reports the following error which is caused by that CONFIG_PM_OPP is unset.

Minor: caused by CONFIG_PM_OPP not being set?

Quoted 3 lines

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]

thanks for catching this.

Quoted 36 lines

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

---
 include/linux/opp.h |   18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)
include/linux/opp.h +2 -9
index 214e0eb..3aca2b8 100644
@@ -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)
 {
@@ -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);

include/linux/opp.h static inline struct srcu_notifier_head *opp_get_notifier(struct device *dev) · line 117

Quoted 10 lines
include/linux/opp.h +7 -0
+#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);
Signature · 2 lines
Regards,
Nishanth Menon
#2 lore raw

PATCH 1/1 PM / OPP: fix condition for empty of_init_opp_table()

In reply to Shawn Guo
Quoted 7 lines · Shawn Guo

randconfig build reports the following error which is caused by that CONFIG_PM_OPP is 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]

Quoted 5 lines

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

Applied to linux-pm.git/linux-next, I'm going to push it to Linus later this week.

Thanks,
Rafael

Quoted 41 lines
---
 include/linux/opp.h |   18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)
include/linux/opp.h +9 -9
index 214e0eb..3aca2b8 100644
@@ -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)
 {
@@ -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);
Signature · 2 lines
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.