From patchwork Tue May 19 13:28:45 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Santosh Shilimkar X-Patchwork-Id: 24712 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n4JDSftu027031 for ; Tue, 19 May 2009 13:28:58 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753278AbZESN2z (ORCPT ); Tue, 19 May 2009 09:28:55 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753372AbZESN2z (ORCPT ); Tue, 19 May 2009 09:28:55 -0400 Received: from bear.ext.ti.com ([192.94.94.41]:36369 "EHLO bear.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753278AbZESN2z (ORCPT ); Tue, 19 May 2009 09:28:55 -0400 Received: from dbdp31.itg.ti.com ([172.24.170.98]) by bear.ext.ti.com (8.13.7/8.13.7) with ESMTP id n4JDSlxp023745; Tue, 19 May 2009 08:28:53 -0500 Received: from linfarm476.india.ti.com (localhost [127.0.0.1]) by dbdp31.itg.ti.com (8.13.8/8.13.8) with ESMTP id n4JDSkcc000588; Tue, 19 May 2009 18:58:46 +0530 (IST) Received: from linfarm476.india.ti.com (localhost [127.0.0.1]) by linfarm476.india.ti.com (8.12.11/8.12.11) with ESMTP id n4JDSjcT012298; Tue, 19 May 2009 18:58:45 +0530 Received: (from a0393909@localhost) by linfarm476.india.ti.com (8.12.11/8.12.11/Submit) id n4JDSjxW012296; Tue, 19 May 2009 18:58:45 +0530 From: Santosh Shilimkar To: linux-arm-kernel@lists.arm.linux.org.uk Cc: linux-omap@vger.kernel.org, Santosh Shilimkar Subject: [PATCH 3/4] ARM: OMAP: Remove useless omap_sram_error function. Date: Tue, 19 May 2009 18:58:45 +0530 Message-Id: <1242739725-12275-1-git-send-email-santosh.shilimkar@ti.com> X-Mailer: git-send-email 1.5.5 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org This patch removes fixes omap_sram_error() function and replace the error paths with BUG_ON. The proposed fix was suggested by Russell King Signed-off-by: Santosh Shilimkar --- arch/arm/plat-omap/sram.c | 25 +++++-------------------- 1 files changed, 5 insertions(+), 20 deletions(-) diff --git a/arch/arm/plat-omap/sram.c b/arch/arm/plat-omap/sram.c index fa5297d..e1493d8 100644 --- a/arch/arm/plat-omap/sram.c +++ b/arch/arm/plat-omap/sram.c @@ -242,20 +242,13 @@ void * omap_sram_push(void * start, unsigned long size) return (void *)omap_sram_ceil; } -static void omap_sram_error(void) -{ - panic("Uninitialized SRAM function\n"); -} - #ifdef CONFIG_ARCH_OMAP1 static void (*_omap_sram_reprogram_clock)(u32 dpllctl, u32 ckctl); void omap_sram_reprogram_clock(u32 dpllctl, u32 ckctl) { - if (!_omap_sram_reprogram_clock) - omap_sram_error(); - + BUG_ON(!_omap_sram_reprogram_clock); _omap_sram_reprogram_clock(dpllctl, ckctl); } @@ -280,9 +273,7 @@ static void (*_omap2_sram_ddr_init)(u32 *slow_dll_ctrl, u32 fast_dll_ctrl, void omap2_sram_ddr_init(u32 *slow_dll_ctrl, u32 fast_dll_ctrl, u32 base_cs, u32 force_unlock) { - if (!_omap2_sram_ddr_init) - omap_sram_error(); - + BUG_ON(!_omap2_sram_ddr_init); _omap2_sram_ddr_init(slow_dll_ctrl, fast_dll_ctrl, base_cs, force_unlock); } @@ -292,9 +283,7 @@ static void (*_omap2_sram_reprogram_sdrc)(u32 perf_level, u32 dll_val, void omap2_sram_reprogram_sdrc(u32 perf_level, u32 dll_val, u32 mem_type) { - if (!_omap2_sram_reprogram_sdrc) - omap_sram_error(); - + BUG_ON(!_omap2_sram_reprogram_sdrc); _omap2_sram_reprogram_sdrc(perf_level, dll_val, mem_type); } @@ -302,9 +291,7 @@ static u32 (*_omap2_set_prcm)(u32 dpll_ctrl_val, u32 sdrc_rfr_val, int bypass); u32 omap2_set_prcm(u32 dpll_ctrl_val, u32 sdrc_rfr_val, int bypass) { - if (!_omap2_set_prcm) - omap_sram_error(); - + BUG_ON(!_omap2_set_prcm); return _omap2_set_prcm(dpll_ctrl_val, sdrc_rfr_val, bypass); } #endif @@ -360,9 +347,7 @@ static u32 (*_omap3_sram_configure_core_dpll)(u32 sdrc_rfr_ctrl, u32 omap3_configure_core_dpll(u32 sdrc_rfr_ctrl, u32 sdrc_actim_ctrla, u32 sdrc_actim_ctrlb, u32 m2) { - if (!_omap3_sram_configure_core_dpll) - omap_sram_error(); - + BUG_ON(!_omap3_sram_configure_core_dpll); return _omap3_sram_configure_core_dpll(sdrc_rfr_ctrl, sdrc_actim_ctrla, sdrc_actim_ctrlb, m2);