All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH V2 1/4] power-domain: add dummy functions when CONFIG_POWER_DOMAIN not defined
@ 2018-07-27  2:20 Peng Fan
  2018-07-27  2:20 ` [U-Boot] [PATCH V2 2/4] power: Add CONFIG_SPL_POWER_DOMAIN config Peng Fan
                   ` (4 more replies)
  0 siblings, 5 replies; 12+ messages in thread
From: Peng Fan @ 2018-07-27  2:20 UTC (permalink / raw)
  To: u-boot

Add dummy functions when CONFIG_POWER_DOMAIN not defined.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
---

V2: Use CONFIG_IS_ENABLED

 include/power-domain.h | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)

diff --git a/include/power-domain.h b/include/power-domain.h
index aba8c0f65c..2029b17c6f 100644
--- a/include/power-domain.h
+++ b/include/power-domain.h
@@ -87,7 +87,14 @@ struct power_domain {
  * @power_domain	A pointer to a power domain struct to initialize.
  * @return 0 if OK, or a negative error code.
  */
+#if CONFIG_IS_ENABLED(POWER_DOMAIN)
 int power_domain_get(struct udevice *dev, struct power_domain *power_domain);
+#else
+int power_domain_get(struct udevice *dev, struct power_domain *power_domain)
+{
+	return -EINVAL;
+}
+#endif
 
 /**
  * power_domain_free - Free a previously requested power domain.
@@ -96,7 +103,14 @@ int power_domain_get(struct udevice *dev, struct power_domain *power_domain);
  *		requested by power_domain_get().
  * @return 0 if OK, or a negative error code.
  */
+#if CONFIG_IS_ENABLED(POWER_DOMAIN)
 int power_domain_free(struct power_domain *power_domain);
+#else
+int power_domain_free(struct power_domain *power_domain)
+{
+	return -EINVAL;
+}
+#endif
 
 /**
  * power_domain_on - Enable power to a power domain.
@@ -105,7 +119,14 @@ int power_domain_free(struct power_domain *power_domain);
  *		requested by power_domain_get().
  * @return 0 if OK, or a negative error code.
  */
+#if CONFIG_IS_ENABLED(POWER_DOMAIN)
 int power_domain_on(struct power_domain *power_domain);
+#else
+int power_domain_on(struct power_domain *power_domain)
+{
+	return -EINVAL;
+}
+#endif
 
 /**
  * power_domain_off - Disable power ot a power domain.
@@ -114,6 +135,13 @@ int power_domain_on(struct power_domain *power_domain);
  *		requested by power_domain_get().
  * @return 0 if OK, or a negative error code.
  */
+#if CONFIG_IS_ENABLED(POWER_DOMAIN)
 int power_domain_off(struct power_domain *power_domain);
+#else
+int power_domain_off(struct power_domain *power_domain)
+{
+	return -EINVAL;
+}
+#endif
 
 #endif
-- 
2.14.1

^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2018-08-06 10:04 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-27  2:20 [U-Boot] [PATCH V2 1/4] power-domain: add dummy functions when CONFIG_POWER_DOMAIN not defined Peng Fan
2018-07-27  2:20 ` [U-Boot] [PATCH V2 2/4] power: Add CONFIG_SPL_POWER_DOMAIN config Peng Fan
2018-07-30 13:26   ` Simon Glass
2018-08-06  9:10   ` Anatolij Gustschin
2018-07-27  2:20 ` [U-Boot] [PATCH V2 3/4] dm: core: device: enable power domain in probe Peng Fan
2018-08-06  9:10   ` Anatolij Gustschin
2018-07-27  2:20 ` [U-Boot] [PATCH V2 4/4] dm: power-domain: query power domain after get device Peng Fan
2018-08-06  9:11   ` Anatolij Gustschin
2018-07-30 13:26 ` [U-Boot] [PATCH V2 1/4] power-domain: add dummy functions when CONFIG_POWER_DOMAIN not defined Simon Glass
2018-08-06  3:02   ` Peng Fan
2018-08-06  9:09 ` Anatolij Gustschin
2018-08-06 10:04   ` Anatolij Gustschin

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.