All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nishanth Menon <nm@ti.com>
To: Linux-OMAP <linux-omap@vger.kernel.org>
Cc: Nishanth Menon <nm@ti.com>, Ambresh K <ambresh@ti.com>,
	Eduardo Valentin <eduardo.valentin@nokia.com>,
	Kevin Hilman <khilman@deeprootsystems.com>
Subject: [PM-WIP-OPP] [PATCH 2/2] omap: opp: return error pointers if inactive opp layer
Date: Tue, 16 Feb 2010 02:27:17 -0600	[thread overview]
Message-ID: <1266308837-23262-3-git-send-email-nm@ti.com> (raw)
In-Reply-To: <1266308837-23262-2-git-send-email-nm@ti.com>

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

Cc: Ambresh K <ambresh@ti.com>
Cc: Eduardo Valentin <eduardo.valentin@nokia.com>
Cc: Kevin Hilman <khilman@deeprootsystems.com>

Signed-off-by: Nishanth Menon <nm@ti.com>
---
 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


  reply	other threads:[~2010-02-16  8:27 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-16  8:27 [PM-WIP-OPP] [PATCH 0/2] cleanups for pointer handling Nishanth Menon
2010-02-16  8:27 ` [PM-WIP-OPP] [PATCH 1/2] omap3:pm:srf: check if pointer results with IS_ERR Nishanth Menon
2010-02-16  8:27   ` Nishanth Menon [this message]
2010-02-23 18:36 ` [PM-WIP-OPP] [PATCH 0/2] cleanups for pointer handling Kevin Hilman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1266308837-23262-3-git-send-email-nm@ti.com \
    --to=nm@ti.com \
    --cc=ambresh@ti.com \
    --cc=eduardo.valentin@nokia.com \
    --cc=khilman@deeprootsystems.com \
    --cc=linux-omap@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.