From patchwork Tue Feb 4 15:58:50 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 3578281 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 53F459F382 for ; Tue, 4 Feb 2014 17:25:54 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 6B4B120158 for ; Tue, 4 Feb 2014 17:25:53 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 766F7200FF for ; Tue, 4 Feb 2014 17:25:52 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WAiS2-0002F1-Be; Tue, 04 Feb 2014 16:02:19 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1WAiRF-0006LB-Vb; Tue, 04 Feb 2014 16:01:29 +0000 Received: from mail-la0-f53.google.com ([209.85.215.53]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WAiPs-00065U-IE for linux-arm-kernel@lists.infradead.org; Tue, 04 Feb 2014 16:00:05 +0000 Received: by mail-la0-f53.google.com with SMTP id e16so6512833lan.26 for ; Tue, 04 Feb 2014 07:59:42 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=ZI5Sul4KUo8FwZ/c1X7+qv7VGKDk9apuZ7UbFqbOB2Q=; b=STCGt/nSzpQwYLOvRX5Rwjq9+LGkhAJ20Poz4J3P/jePfyWLrv8NHLnqPOlZaQyIkS dcPuJehAI+jY74edbbp+Usrf6/+Sb+JoEvX/xvY3Cc9fXCMnUPHPsaCGJjF/ICPmmLGf Q9mQ8LiKry2dKPV6zRyCGLRIq5FyiXWgrhMTdOUu/4sik9o09gN0nWsNuA+kML5R6dO6 yq852fpPlfcEpIrOg0on2BHmA8ZRfJ0i2cKgVgTu5vM6tdfb9Gv1YmVv2OdZ2BpmsGx0 oJrt4fwURgrHIdWEN74SoyLKunIkgJmwpp0MYg2+mJ7bP+CrXGjC8jYiY/kP5B+5kgN2 5S/A== X-Gm-Message-State: ALoCoQkkw8n/NymN1uF2K4OZCSoS3EKSqtaYAPRaWvIntIpX5iD6cOBvxL+W2kEX9mkekxLpmLjL X-Received: by 10.152.1.130 with SMTP id 2mr127382lam.88.1391529582391; Tue, 04 Feb 2014 07:59:42 -0800 (PST) Received: from localhost.localdomain (host-95-199-220-119.mobileonline.telia.com. [95.199.220.119]) by mx.google.com with ESMTPSA id dm8sm35906603lad.7.2014.02.04.07.59.39 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 04 Feb 2014 07:59:41 -0800 (PST) From: Ulf Hansson To: Russell King , linux-arm-kernel@lists.infradead.org Subject: [PATCH 09/17] spi: pl022: Simplify clock handling Date: Tue, 4 Feb 2014 16:58:50 +0100 Message-Id: <1391529538-21685-10-git-send-email-ulf.hansson@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1391529538-21685-1-git-send-email-ulf.hansson@linaro.org> References: <1391529538-21685-1-git-send-email-ulf.hansson@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140204_110004_804608_43120845 X-CRM114-Status: GOOD ( 11.12 ) X-Spam-Score: -2.6 (--) Cc: Ulf Hansson , Wolfram Sang , Linus Walleij , linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org, Chris Ball , Mark Brown , linux-i2c@vger.kernel.org, linux-spi@vger.kernel.org, Alessandro Rubini X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.8 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Make use of clk_prepare_enable and clk_disable_unprepare to simplify code. No functional change. Cc: Mark Brown Signed-off-by: Ulf Hansson --- drivers/spi/spi-pl022.c | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/drivers/spi/spi-pl022.c b/drivers/spi/spi-pl022.c index 2bb238f..2f44c81 100644 --- a/drivers/spi/spi-pl022.c +++ b/drivers/spi/spi-pl022.c @@ -2183,13 +2183,7 @@ static int pl022_probe(struct amba_device *adev, const struct amba_id *id) goto err_no_clk; } - status = clk_prepare(pl022->clk); - if (status) { - dev_err(&adev->dev, "could not prepare SSP/SPI bus clock\n"); - goto err_clk_prep; - } - - status = clk_enable(pl022->clk); + status = clk_prepare_enable(pl022->clk); if (status) { dev_err(&adev->dev, "could not enable SSP/SPI bus clock\n"); goto err_no_clk_en; @@ -2250,10 +2244,8 @@ static int pl022_probe(struct amba_device *adev, const struct amba_id *id) if (platform_info->enable_dma) pl022_dma_remove(pl022); err_no_irq: - clk_disable(pl022->clk); + clk_disable_unprepare(pl022->clk); err_no_clk_en: - clk_unprepare(pl022->clk); - err_clk_prep: err_no_clk: err_no_ioremap: amba_release_regions(adev); @@ -2281,8 +2273,7 @@ pl022_remove(struct amba_device *adev) if (pl022->master_info->enable_dma) pl022_dma_remove(pl022); - clk_disable(pl022->clk); - clk_unprepare(pl022->clk); + clk_disable_unprepare(pl022->clk); amba_release_regions(adev); tasklet_disable(&pl022->pump_transfers); return 0;