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: 3577471 Return-Path: X-Original-To: patchwork-linux-spi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 24C46C02DC for ; Tue, 4 Feb 2014 16:03:37 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4269120179 for ; Tue, 4 Feb 2014 16:03:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7166720170 for ; Tue, 4 Feb 2014 16:03:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754784AbaBDQDC (ORCPT ); Tue, 4 Feb 2014 11:03:02 -0500 Received: from mail-la0-f46.google.com ([209.85.215.46]:39948 "EHLO mail-la0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932133AbaBDP7n (ORCPT ); Tue, 4 Feb 2014 10:59:43 -0500 Received: by mail-la0-f46.google.com with SMTP id b8so6680500lan.33 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=UMunloNyrNvcqUpbxXQQapn+uRk88VPCHrIdma0JGneBUvJXVk4W6RYRjSknubdRrh MtHtx63iyA+XMqid9iE3sGOVi7EaisaQ5vsoyC/zFPFYmOJMpbhQkteBeVr4ytQ5pWys Yl7Tcb64nX7vKgGVdGO3awsiWMgd6ZLtpgTa0Hshf4xqI8GpavvUkaKx/5qzdZXrWsnJ Egz5aMevjBbm8x6VNGN7Ciu+J1x87GZmpI7G9Z+1xKQNZ0sCzpoDzc24N8Z0HhL7jRHA 2qA+lQFqtIUSGknqP4xLr1zu465oQwgCfU4frgok1I8nCyU27QgBEDAtMZN2YOSN5syY CPfw== X-Gm-Message-State: ALoCoQnZiHcaS917r22QtJ69tTEocVJVAIyEx7q0cdtwu6ocflzGjkWvDuGnqXPoup5cGSofr8YM 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> Sender: linux-spi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham 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;