[U-Boot] [PATCH 01/12] regulator: Change get_enable return type to integer from bool

Keerthy j-keerthy at ti.com
Tue Jun 13 04:23:45 UTC 2017


Change get_enable return type to int so errors can be returned.

Signed-off-by: Keerthy <j-keerthy at ti.com>
---
 drivers/power/regulator/regulator-uclass.c | 2 +-
 include/power/regulator.h                  | 8 ++++----
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/power/regulator/regulator-uclass.c b/drivers/power/regulator/regulator-uclass.c
index 0a1d1b3..426a933 100644
--- a/drivers/power/regulator/regulator-uclass.c
+++ b/drivers/power/regulator/regulator-uclass.c
@@ -96,7 +96,7 @@ int regulator_set_current(struct udevice *dev, int uA)
 	return ops->set_current(dev, uA);
 }
 
-bool regulator_get_enable(struct udevice *dev)
+int regulator_get_enable(struct udevice *dev)
 {
 	const struct dm_regulator_ops *ops = dev_get_driver_ops(dev);
 
diff --git a/include/power/regulator.h b/include/power/regulator.h
index 1a8e575..2bbc1e5 100644
--- a/include/power/regulator.h
+++ b/include/power/regulator.h
@@ -211,9 +211,9 @@ struct dm_regulator_ops {
 	 * @dev           - regulator device
 	 * Sets:
 	 * @enable         - set true - enable or false - disable
-	 * @return true/false for get; or 0 / -errno for set.
+	 * @return true/false for get or -errno if fail; 0 / -errno for set.
 	 */
-	bool (*get_enable)(struct udevice *dev);
+	int (*get_enable)(struct udevice *dev);
 	int (*set_enable)(struct udevice *dev, bool enable);
 
 	/**
@@ -291,9 +291,9 @@ int regulator_set_current(struct udevice *dev, int uA);
  * regulator_get_enable: get regulator device enable state.
  *
  * @dev    - pointer to the regulator device
- * @return - true/false of enable state
+ * @return - true/false of enable state or -errno val if fails
  */
-bool regulator_get_enable(struct udevice *dev);
+int regulator_get_enable(struct udevice *dev);
 
 /**
  * regulator_set_enable: set regulator enable state
-- 
1.9.1



More information about the U-Boot mailing list