From patchwork Wed Mar 11 15:29:34 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Atal Shargorodsky X-Patchwork-Id: 11160 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 n2BFV9RD004300 for ; Wed, 11 Mar 2009 15:31:09 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753517AbZCKPbI (ORCPT ); Wed, 11 Mar 2009 11:31:08 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753553AbZCKPbI (ORCPT ); Wed, 11 Mar 2009 11:31:08 -0400 Received: from smtp.nokia.com ([192.100.122.230]:45622 "EHLO mgw-mx03.nokia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753517AbZCKPbF (ORCPT ); Wed, 11 Mar 2009 11:31:05 -0400 Received: from vaebh105.NOE.Nokia.com (vaebh105.europe.nokia.com [10.160.244.31]) by mgw-mx03.nokia.com (Switch-3.2.6/Switch-3.2.6) with ESMTP id n2BFUKMi025456; Wed, 11 Mar 2009 17:30:49 +0200 Received: from esebh102.NOE.Nokia.com ([172.21.138.183]) by vaebh105.NOE.Nokia.com with Microsoft SMTPSVC(6.0.3790.3959); Wed, 11 Mar 2009 17:30:16 +0200 Received: from mgw-int01.ntc.nokia.com ([172.21.143.96]) by esebh102.NOE.Nokia.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.3959); Wed, 11 Mar 2009 17:30:15 +0200 Received: from localhost.localdomain (esdhcp042174.research.nokia.com [172.21.42.174]) by mgw-int01.ntc.nokia.com (Switch-3.2.5/Switch-3.2.5) with ESMTP id n2BFUB30017872; Wed, 11 Mar 2009 17:30:14 +0200 From: Atal Shargorodsky To: linux-omap@vger.kernel.org Cc: linux-arm-kernel@lists.arm.linux.org.uk, Atal Shargorodsky Subject: [PATCH 2/6] OMAP: omap_wdt: Fix interface clock existence check. Date: Wed, 11 Mar 2009 17:29:34 +0200 Message-Id: <0fe7f2934f8416e9b5f05e2f18766362560116ee.1236609434.git.ext-atal.shargorodsky@nokia.com> X-Mailer: git-send-email 1.5.4.3 In-Reply-To: References: <> <1236785378-14640-1-git-send-email-ext-atal.shargorodsky@nokia.com> In-Reply-To: References: X-OriginalArrivalTime: 11 Mar 2009 15:30:15.0858 (UTC) FILETIME=[47000920:01C9A25E] X-Nokia-AV: Clean Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org When enabling/disabling the iterface clock, the question to be asked is if this clock exists rather than to decide about it's existance by retrieving the chip version. It can be done only once at init time. Signed-off-by: Atal Shargorodsky --- drivers/watchdog/omap_wdt.c | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/watchdog/omap_wdt.c b/drivers/watchdog/omap_wdt.c index 5b72c7c..05dc55a 100644 --- a/drivers/watchdog/omap_wdt.c +++ b/drivers/watchdog/omap_wdt.c @@ -145,7 +145,7 @@ static int omap_wdt_open(struct inode *inode, struct file *file) if (test_and_set_bit(1, (unsigned long *)&(wdev->omap_wdt_users))) return -EBUSY; - if (cpu_is_omap24xx() || cpu_is_omap34xx()) + if (wdev->mpu_wdt_ick) clk_enable(wdev->mpu_wdt_ick); /* Enable the interface clock */ clk_enable(wdev->mpu_wdt_fck); /* Enable the functional clock */ @@ -177,7 +177,7 @@ static int omap_wdt_release(struct inode *inode, struct file *file) omap_wdt_disable(wdev); - if (cpu_is_omap24xx() || cpu_is_omap34xx()) + if (wdev->mpu_wdt_ick) clk_disable(wdev->mpu_wdt_ick); /* Disable the clock */ clk_disable(wdev->mpu_wdt_fck); /* Disable the clock */ @@ -344,7 +344,7 @@ static int __init omap_wdt_probe(struct platform_device *pdev) platform_set_drvdata(pdev, wdev); /* enable clocks for register access */ - if (cpu_is_omap24xx() || cpu_is_omap34xx()) + if (wdev->mpu_wdt_ick) clk_enable(wdev->mpu_wdt_ick); /* Enable the interface clock */ clk_enable(wdev->mpu_wdt_fck); /* Enable the functional clock */ @@ -369,7 +369,7 @@ static int __init omap_wdt_probe(struct platform_device *pdev) __raw_writel(0x01, wdev->base + OMAP_WATCHDOG_SYS_CONFIG); /* disable clocks since we don't need them now */ - if (cpu_is_omap24xx() || cpu_is_omap34xx()) + if (wdev->mpu_wdt_ick) clk_disable(wdev->mpu_wdt_ick); /* Disable the clock */ clk_disable(wdev->mpu_wdt_fck); /* Disable the clock */