From patchwork Fri Jan 15 11:03:03 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Dasgupta, Romit" X-Patchwork-Id: 73143 X-Patchwork-Delegate: khilman@deeprootsystems.com Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.2) with ESMTP id o0FB3XOe024142 for ; Fri, 15 Jan 2010 11:03:33 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751709Ab0AOLDM (ORCPT ); Fri, 15 Jan 2010 06:03:12 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1756779Ab0AOLDL (ORCPT ); Fri, 15 Jan 2010 06:03:11 -0500 Received: from arroyo.ext.ti.com ([192.94.94.40]:41526 "EHLO arroyo.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753847Ab0AOLDJ (ORCPT ); Fri, 15 Jan 2010 06:03:09 -0500 Received: from dbdp31.itg.ti.com ([172.24.170.98]) by arroyo.ext.ti.com (8.13.7/8.13.7) with ESMTP id o0FB36sM031755 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 15 Jan 2010 05:03:08 -0600 Received: from [172.24.190.243] (localhost [127.0.0.1]) by dbdp31.itg.ti.com (8.13.8/8.13.8) with ESMTP id o0FB33td011467; Fri, 15 Jan 2010 16:33:03 +0530 (IST) Subject: [PM-WIP-OPP] [PATCH 2/2]: Change return value from ERR_PTR(..) to NULL in opp layer From: Romit Dasgupta Reply-To: romit@ti.com To: khilman@deeprootsystems.com Cc: nm@ti.com, linux-omap@vger.kernel.org Organization: Texas Instruments Date: Fri, 15 Jan 2010 16:33:03 +0530 Message-ID: <1263553383.3490.44.camel@boson> Mime-Version: 1.0 X-Mailer: Evolution 2.28.1 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org diff --git a/arch/arm/mach-omap2/resource34xx.c b/arch/arm/mach-omap2/resource34xx.c index 5ec072e..9572062 100644 --- a/arch/arm/mach-omap2/resource34xx.c +++ b/arch/arm/mach-omap2/resource34xx.c @@ -202,7 +202,7 @@ static int __deprecated freq_to_opp(u8 *opp_id, enum opp_t opp_t, BUG_ON(opp_t >= OPP_TYPES_MAX); opp = opp_find_freq_ceil(opp_t, &freq); - if (IS_ERR(opp)) + if (!opp) return -EINVAL; *opp_id = opp_get_opp_id(opp); return 0; diff --git a/arch/arm/plat-omap/opp.c b/arch/arm/plat-omap/opp.c index 8fd9366..7835b5d 100644 --- a/arch/arm/plat-omap/opp.c +++ b/arch/arm/plat-omap/opp.c @@ -129,7 +129,7 @@ struct omap_opp *opp_find_freq_exact(enum opp_t opp_t, if (unlikely(opp_t >= OPP_TYPES_MAX)) { pr_err("%s: Invalid parameters being passed\n", __func__); - return ERR_PTR(-EINVAL); + return NULL; } oppl = _opp_list[opp_t]; @@ -143,7 +143,7 @@ struct omap_opp *opp_find_freq_exact(enum opp_t opp_t, oppl++; } - return OPP_TERM(oppl) ? ERR_PTR(-ENOENT) : oppl; + return OPP_TERM(oppl) ? NULL : oppl; } struct omap_opp *opp_find_freq_ceil(enum opp_t opp_t, unsigned long *freq) @@ -153,7 +153,7 @@ struct omap_opp *opp_find_freq_ceil(enum opp_t opp_t, unsigned long *freq) if (unlikely(opp_t >= OPP_TYPES_MAX || !freq || IS_ERR(freq))) { pr_err("%s: Invalid parameters being passed\n", __func__); - return ERR_PTR(-EINVAL); + return NULL; } oppl = _opp_list[opp_t]; @@ -169,7 +169,7 @@ struct omap_opp *opp_find_freq_ceil(enum opp_t opp_t, unsigned long *freq) } if (OPP_TERM(oppl)) - return ERR_PTR(-ENOENT); + return NULL; *freq = oppl->rate; @@ -183,7 +183,7 @@ struct omap_opp *opp_find_freq_floor(enum opp_t opp_t, unsigned long *freq) if (unlikely(opp_t >= OPP_TYPES_MAX || !freq || IS_ERR(freq))) { pr_err("%s: Invalid parameters being passed\n", __func__); - return ERR_PTR(-EINVAL); + return NULL; } oppl = prev_opp = _opp_list[opp_t]; @@ -202,7 +202,7 @@ struct omap_opp *opp_find_freq_floor(enum opp_t opp_t, unsigned long *freq) } if (prev_opp->rate > *freq) - return ERR_PTR(-ENOENT); + return NULL; *freq = prev_opp->rate;