From patchwork Thu Sep 27 15:06:36 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 11764 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 7FD7D23E54 for ; Thu, 27 Sep 2012 15:07:33 +0000 (UTC) Received: from mail-ie0-f180.google.com (mail-ie0-f180.google.com [209.85.223.180]) by fiordland.canonical.com (Postfix) with ESMTP id 2A0F0A1884F for ; Thu, 27 Sep 2012 15:07:33 +0000 (UTC) Received: by ieje10 with SMTP id e10so4437246iej.11 for ; Thu, 27 Sep 2012 08:07:32 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:from:to:cc :subject:date:message-id:x-mailer:mime-version:content-type :x-gm-message-state; bh=1I20divHejQ92RmRfCUIWq3ob18rYpRhNymjiNT6bTk=; b=hAC0M3U69eIu0VfVDrIdFdjCuX8nvCOemLF7carMKxxnVgunQNxuQ6uDlqfx/TTn12 zk6mkaeJSbM+WGz/u6mH4vuctht6Fqfs6v7DhbL1LWbbyDxaf71yxZkFnY2dwK+EiCjJ anX28AK9wjWyIW1XpZDCPhojEezu4LbYQqYn/iatfUSF/NRd6lYooSdzDHNum5CXRxLB u+rmVu1kso5yIEi4YXmCajHJnVP5NLSOT2Lw9Q2v7MFsWVOCD+jINaf7tGMPzQ5sWMGJ PaCfO1iBesZcj03SskoaFqxEKqJz+9JHkXlIO0Xo1Q+JChl8Om0AIbuJe/dyjEsvZtsP FXNg== Received: by 10.50.160.165 with SMTP id xl5mr5047913igb.0.1348758452459; Thu, 27 Sep 2012 08:07:32 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.50.184.232 with SMTP id ex8csp420567igc; Thu, 27 Sep 2012 08:07:31 -0700 (PDT) Received: by 10.14.180.65 with SMTP id i41mr6273206eem.10.1348758450129; Thu, 27 Sep 2012 08:07:30 -0700 (PDT) Received: from eu1sys200aog105.obsmtp.com (eu1sys200aog105.obsmtp.com [207.126.144.119]) by mx.google.com with SMTP id j47si87193eep.134.2012.09.27.08.07.14 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 27 Sep 2012 08:07:29 -0700 (PDT) Received-SPF: neutral (google.com: 207.126.144.119 is neither permitted nor denied by best guess record for domain of ulf.hansson@stericsson.com) client-ip=207.126.144.119; Authentication-Results: mx.google.com; spf=neutral (google.com: 207.126.144.119 is neither permitted nor denied by best guess record for domain of ulf.hansson@stericsson.com) smtp.mail=ulf.hansson@stericsson.com Received: from beta.dmz-eu.st.com ([164.129.1.35]) (using TLSv1) by eu1sys200aob105.postini.com ([207.126.147.11]) with SMTP ID DSNKUGRrohTf65ZHQhg7l5jLtnV6pM0Vhvf7@postini.com; Thu, 27 Sep 2012 15:07:29 UTC Received: from zeta.dmz-eu.st.com (zeta.dmz-eu.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id DE558128; Thu, 27 Sep 2012 15:06:40 +0000 (GMT) Received: from relay1.stm.gmessaging.net (unknown [10.230.100.17]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 9101A471D; Thu, 27 Sep 2012 15:06:40 +0000 (GMT) Received: from exdcvycastm022.EQ1STM.local (alteon-source-exch [10.230.100.61]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (Client CN "exdcvycastm022", Issuer "exdcvycastm022" (not verified)) by relay1.stm.gmessaging.net (Postfix) with ESMTPS id 4ABD824C07C; Thu, 27 Sep 2012 17:06:32 +0200 (CEST) Received: from steludxu1397.lud.stericsson.com (10.230.100.153) by smtp.stericsson.com (10.230.100.30) with Microsoft SMTP Server (TLS) id 8.3.83.0; Thu, 27 Sep 2012 17:06:39 +0200 From: Ulf Hansson To: Grant Likely , Cc: , Linus Walleij , Vipul Kumar Samar , Viresh Kumar , Ulf Hansson Subject: [PATCH V2] spi/pl022: Simplify use of runtime pm Date: Thu, 27 Sep 2012 17:06:36 +0200 Message-ID: <1348758396-25276-1-git-send-email-ulf.hansson@stericsson.com> X-Mailer: git-send-email 1.7.10 MIME-Version: 1.0 X-Gm-Message-State: ALoCoQm7FpBsqlkh3yjvuHUg27OFLwyPFcQm5bdF6ZO5hc+mMz53BVf086sjMmU6X4PsUydZW7we From: Ulf Hansson In probe the pm_runtime_resume is not needed since the amba bus has already set the device in "resumed" state by using pm_runtime_set_active. Additionally more simplifications is done in probe by removing pm_runtime_put_autosuspend. pm_runtime_put_autosuspend does in probe functions have same effect as doing pm_runtime_put. This due to upper layer in driver core is preventing the device from being runtime suspended by a pm_runtime_get*. Finally, removing pm_runtime_disable from the remove function can be done since it is already handled by the amba bus. Signed-off-by: Ulf Hansson --- V2: Clearification added in commit message --- drivers/spi/spi-pl022.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/spi/spi-pl022.c b/drivers/spi/spi-pl022.c index f8568b4..e51a026 100644 --- a/drivers/spi/spi-pl022.c +++ b/drivers/spi/spi-pl022.c @@ -2188,8 +2188,6 @@ pl022_probe(struct amba_device *adev, const struct amba_id *id) printk(KERN_INFO "pl022: mapped registers from 0x%08x to %p\n", adev->res.start, pl022->virtbase); - pm_runtime_resume(dev); - pl022->clk = clk_get(&adev->dev, NULL); if (IS_ERR(pl022->clk)) { status = PTR_ERR(pl022->clk); @@ -2250,10 +2248,9 @@ pl022_probe(struct amba_device *adev, const struct amba_id *id) pm_runtime_set_autosuspend_delay(dev, platform_info->autosuspend_delay); pm_runtime_use_autosuspend(dev); - pm_runtime_put_autosuspend(dev); - } else { - pm_runtime_put(dev); } + pm_runtime_put(dev); + return 0; err_spi_register: @@ -2302,7 +2299,6 @@ pl022_remove(struct amba_device *adev) clk_disable(pl022->clk); clk_unprepare(pl022->clk); clk_put(pl022->clk); - pm_runtime_disable(&adev->dev); iounmap(pl022->virtbase); amba_release_regions(adev); tasklet_disable(&pl022->pump_transfers);