[PM-WIP-OPP] [PATCH 2/2] omap: opp: return error pointers if inactive opp layer

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Return ERR_PTR pointers back to caller instead of a plain
NULL to allow for callers to do sanity checks.

Cc: Ambresh K <ambresh@xxxxxx>
Cc: Eduardo Valentin <eduardo.valentin@xxxxxxxxx>
Cc: Kevin Hilman <khilman@xxxxxxxxxxxxxxxxxxx>

Signed-off-by: Nishanth Menon <nm@xxxxxx>
---
 arch/arm/plat-omap/include/plat/opp.h |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/arch/arm/plat-omap/include/plat/opp.h b/arch/arm/plat-omap/include/plat/opp.h
index 33d224c..dc9a0d9 100644
--- a/arch/arm/plat-omap/include/plat/opp.h
+++ b/arch/arm/plat-omap/include/plat/opp.h
@@ -252,31 +252,31 @@ static inline int opp_get_opp_count(struct omap_opp *oppl)
 static inline struct omap_opp *opp_find_freq_exact(struct omap_opp *oppl,
 				     unsigned long freq, bool enabled)
 {
-	return NULL;
+	return ERR_PTR(-EINVAL);
 }
 
 static inline struct omap_opp *opp_find_freq_floor(struct omap_opp *oppl,
 				     unsigned long *freq)
 {
-	return NULL;
+	return ERR_PTR(-EINVAL);
 }
 
 static inline struct omap_opp *opp_find_freq_ceil(struct omap_opp *oppl,
 					unsigned long *freq)
 {
-	return NULL;
+	return ERR_PTR(-EINVAL);
 }
 
 static inline
 struct omap_opp __init *opp_init_list(const struct omap_opp_def *opp_defs)
 {
-	return NULL;
+	return ERR_PTR(-EINVAL);
 }
 
 static inline struct omap_opp *opp_add(struct omap_opp *oppl,
 			 const struct omap_opp_def *opp_def)
 {
-	return NULL;
+	return ERR_PTR(-EINVAL);
 }
 
 static inline int opp_enable(struct omap_opp *opp)
@@ -292,7 +292,7 @@ static inline int opp_disable(struct omap_opp *opp)
 static inline struct omap_opp * __deprecated
 opp_find_by_opp_id(struct omap_opp *opps, u8 opp_id)
 {
-	return NULL;
+	return ERR_PTR(-EINVAL);
 }
 
 static inline u8 __deprecated opp_get_opp_id(struct omap_opp *opp)
-- 
1.6.3.3

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Arm (vger)]     [ARM Kernel]     [ARM MSM]     [Linux Tegra]     [Linux WPAN Networking]     [Linux Wireless Networking]     [Maemo Users]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux