From patchwork Thu Aug 20 20:11:03 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heiner Kallweit X-Patchwork-Id: 7046961 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.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 0D81AC05AC for ; Thu, 20 Aug 2015 20:13:51 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2F9E320444 for ; Thu, 20 Aug 2015 20:13:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5832220453 for ; Thu, 20 Aug 2015 20:13:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752302AbbHTUNp (ORCPT ); Thu, 20 Aug 2015 16:13:45 -0400 Received: from mail-wi0-f169.google.com ([209.85.212.169]:33987 "EHLO mail-wi0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752452AbbHTUNp (ORCPT ); Thu, 20 Aug 2015 16:13:45 -0400 Received: by wicne3 with SMTP id ne3so2724495wic.1; Thu, 20 Aug 2015 13:13:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :content-type:content-transfer-encoding; bh=u5UmhpalcWx1TVkrCnno+gYYXVXs8NXAu7yzKDt2OgE=; b=C4HtkQMh/Uzaono5vjxSj6j+WwGVR5sKopAebjlfsF+DBur3ipi8xiX2VEgnZhLjsq mCwoZLrDHYamSxb+thf0S2t0CFx+6N1TKxAfiDTplkVWskDfihXYY0AJzcpOnCvHN8I4 FIlav7bsHT3X6MYs5PS2C89LHLSb4ONVw0L1XxB0R6GAk11Kgl0Gp8NSJlF3OCnIWLlm ukop2R14qgxZfPcYjmI76lY4GtRaxPBsKuJrHmJC8U7o/DwJinUmris1lTNaJmPDBf9W 33M9gZ5tkeGcqh59LEHW6C1+c/oYrzTMZjZfNcHqQjGzy5oq8NIwPTFGgf+7SbBsldmQ b1mw== X-Received: by 10.194.58.236 with SMTP id u12mr9747365wjq.36.1440101623963; Thu, 20 Aug 2015 13:13:43 -0700 (PDT) Received: from ?IPv6:2003:62:5f33:d300:fd69:4033:8d2f:d215? (p200300625F33D300FD6940338D2FD215.dip0.t-ipconnect.de. [2003:62:5f33:d300:fd69:4033:8d2f:d215]) by smtp.googlemail.com with ESMTPSA id p1sm6982799wjq.28.2015.08.20.13.13.43 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 20 Aug 2015 13:13:43 -0700 (PDT) Message-ID: <55D63457.5060901@gmail.com> Date: Thu, 20 Aug 2015 22:11:03 +0200 From: Heiner Kallweit User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: Krzysztof Kozlowski CC: linux-samsung-soc@vger.kernel.org, "linux-spi@vger.kernel.org" Subject: [PATCH 4/4 RESEND] spi: s3c64xx: replace clock disabling with runtime PM suspend call in remove function 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.4 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, 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 Simplify s3c64xx_spi_remove by replacing the clock disabling with calling runtime PM suspend which does the same. Waking up the device if it was suspended wouldn't be strictly needed for this driver but using pm_runtime_get_sync is cleaner and makes s3c64xx_spi_remove more consistent with the runtime PM handling in s3c64xx_spi_setup. pm_runtime_force_suspend does most of the work for us: disabling the clocks, disabling runtime PM and setting it to "suspended" state. Signed-off-by: Heiner Kallweit --- Changed: - Added to the patch set drivers/spi/spi-s3c64xx.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/spi/spi-s3c64xx.c b/drivers/spi/spi-s3c64xx.c index 735b7f5..4a91a6c 100644 --- a/drivers/spi/spi-s3c64xx.c +++ b/drivers/spi/spi-s3c64xx.c @@ -1225,13 +1225,12 @@ static int s3c64xx_spi_remove(struct platform_device *pdev) struct spi_master *master = spi_master_get(platform_get_drvdata(pdev)); struct s3c64xx_spi_driver_data *sdd = spi_master_get_devdata(master); - pm_runtime_disable(&pdev->dev); + pm_runtime_get_sync(&pdev->dev); writel(0, sdd->regs + S3C64XX_SPI_INT_EN); - clk_disable_unprepare(sdd->src_clk); - - clk_disable_unprepare(sdd->clk); + pm_runtime_put_noidle(&pdev->dev); + pm_runtime_force_suspend(&pdev->dev); return 0; }