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: 24116 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-vb0-f70.google.com (mail-vb0-f70.google.com [209.85.212.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 1CD39202FA for ; Tue, 4 Feb 2014 15:59:47 +0000 (UTC) Received: by mail-vb0-f70.google.com with SMTP id w17sf21886010vbj.9 for ; Tue, 04 Feb 2014 07:59:47 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=ZI5Sul4KUo8FwZ/c1X7+qv7VGKDk9apuZ7UbFqbOB2Q=; b=dzVidxozh4aQD1+bgMx2GOd/vhwEW+ExRbA2uTMerdwSH1Zie+vxXR4tjHNRV1w5Tj hd5U+ygUptRx7425sQNhpw89SYNrZK9qQYNnT3p4a43++4kb1L+glTgwttizr9lHmKzC MxIkjlxuwaDxroaSZTI22flvwA4bJlOuPOSJaBZ9lhgwPI+nL79IwVvl+8JSR/t7Y9WA /YY36INR9sJG25c9dOuGMOIknEBxQSERQ0isFf4EDOBpRs6YyoVos4xO8K80pCPI8URY Nee49GW83O08WLPN8a9CZCTRyyRsPTuvV6JPSkf2NNdjJN19biKmxJnqadxwRTTIdViY 7k4A== X-Gm-Message-State: ALoCoQkOH7wm7GrrMg2JHwJQmdlBZGiR4Acyzs6krmcwq8wDFq8DnU7824nMYi11ac7LnoBQtkrt X-Received: by 10.58.32.131 with SMTP id j3mr15555613vei.13.1391529587182; Tue, 04 Feb 2014 07:59:47 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.91.180 with SMTP id z49ls2285182qgd.59.gmail; Tue, 04 Feb 2014 07:59:46 -0800 (PST) X-Received: by 10.52.236.132 with SMTP id uu4mr468344vdc.47.1391529586920; Tue, 04 Feb 2014 07:59:46 -0800 (PST) Received: from mail-ve0-f174.google.com (mail-ve0-f174.google.com [209.85.128.174]) by mx.google.com with ESMTPS id xw5si8315567vec.46.2014.02.04.07.59.46 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 04 Feb 2014 07:59:46 -0800 (PST) Received-SPF: neutral (google.com: 209.85.128.174 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.174; Received: by mail-ve0-f174.google.com with SMTP id pa12so6158703veb.33 for ; Tue, 04 Feb 2014 07:59:46 -0800 (PST) X-Received: by 10.52.233.137 with SMTP id tw9mr15036vdc.84.1391529586846; Tue, 04 Feb 2014 07:59:46 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.174.196 with SMTP id u4csp245379vcz; Tue, 4 Feb 2014 07:59:46 -0800 (PST) X-Received: by 10.152.209.7 with SMTP id mi7mr2338892lac.42.1391529585724; Tue, 04 Feb 2014 07:59:45 -0800 (PST) Received: from mail-la0-f53.google.com (mail-la0-f53.google.com [209.85.215.53]) by mx.google.com with ESMTPS id pt10si12956389lbb.123.2014.02.04.07.59.42 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 04 Feb 2014 07:59:45 -0800 (PST) Received-SPF: neutral (google.com: 209.85.215.53 is neither permitted nor denied by best guess record for domain of ulf.hansson@linaro.org) client-ip=209.85.215.53; Received: by mail-la0-f53.google.com with SMTP id e16so6719730lan.12 for ; Tue, 04 Feb 2014 07:59:42 -0800 (PST) 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 Cc: Alessandro Rubini , Linus Walleij , Wolfram Sang , Chris Ball , Mark Brown , linux-kernel@vger.kernel.org, linux-i2c@vger.kernel.org, linux-spi@vger.kernel.org, linux-mmc@vger.kernel.org, Ulf Hansson 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-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: ulf.hansson@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.174 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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;