From patchwork Thu Feb 19 15:24:02 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Phil Carmody X-Patchwork-Id: 7994 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 n1JFOVPd002828 for ; Thu, 19 Feb 2009 15:24:31 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751189AbZBSPYa (ORCPT ); Thu, 19 Feb 2009 10:24:30 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751254AbZBSPYa (ORCPT ); Thu, 19 Feb 2009 10:24:30 -0500 Received: from smtp.nokia.com ([192.100.122.233]:35442 "EHLO mgw-mx06.nokia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751189AbZBSPY3 (ORCPT ); Thu, 19 Feb 2009 10:24:29 -0500 Received: from esebh106.NOE.Nokia.com (esebh106.ntc.nokia.com [172.21.138.213]) by mgw-mx06.nokia.com (Switch-3.2.6/Switch-3.2.6) with ESMTP id n1JFO8VT019485 for ; Thu, 19 Feb 2009 17:24:26 +0200 Received: from vaebh104.NOE.Nokia.com ([10.160.244.30]) by esebh106.NOE.Nokia.com with Microsoft SMTPSVC(6.0.3790.3959); Thu, 19 Feb 2009 17:24:22 +0200 Received: from mgw-int01.ntc.nokia.com ([172.21.143.96]) by vaebh104.NOE.Nokia.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.3959); Thu, 19 Feb 2009 17:24:19 +0200 Received: from localhost.localdomain (esdhcp039196.research.nokia.com [172.21.39.196]) by mgw-int01.ntc.nokia.com (Switch-3.2.5/Switch-3.2.5) with ESMTP id n1JFOGtC026540; Thu, 19 Feb 2009 17:24:18 +0200 From: Phil Carmody To: linux-omap@vger.kernel.org Cc: Phil Carmody Subject: [PATCH 1/1] OMAP: McSPI: Unpaired clk_{en,dis}able calls. Date: Thu, 19 Feb 2009 17:24:02 +0200 Message-Id: X-Mailer: git-send-email 1.5.4.3 In-Reply-To: <1235057042-6833-1-git-send-email-ext-phil.2.carmody@nokia.com> References: <> <1235057042-6833-1-git-send-email-ext-phil.2.carmody@nokia.com> X-OriginalArrivalTime: 19 Feb 2009 15:24:19.0556 (UTC) FILETIME=[225DAA40:01C992A6] X-Nokia-AV: Clean Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org If the sky is always blue, and no functions fail, then the interface and functional clocks will always be in the same state. However, defensively, failure to enable the 2nd should re-disable the 1st. Signed-off-by: Phil Carmody --- drivers/spi/omap2_mcspi.c | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/spi/omap2_mcspi.c b/drivers/spi/omap2_mcspi.c index 3da8825..bdccb27 100644 --- a/drivers/spi/omap2_mcspi.c +++ b/drivers/spi/omap2_mcspi.c @@ -277,9 +277,10 @@ static int omap2_mcspi_enable_clocks(struct omap2_mcspi *mcspi) { if (clk_enable(mcspi->ick)) return -ENODEV; - if (clk_enable(mcspi->fck)) + if (clk_enable(mcspi->fck)) { + clk_disable(mcspi->ick); return -ENODEV; - + } omap2_mcspi_restore_ctx(mcspi); return 0;