From patchwork Fri Aug 21 17:31:54 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heiner Kallweit X-Patchwork-Id: 7052891 Return-Path: X-Original-To: patchwork-linux-samsung-soc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 7C0079F358 for ; Fri, 21 Aug 2015 17:40:37 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id AA35820452 for ; Fri, 21 Aug 2015 17:40:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C524A20451 for ; Fri, 21 Aug 2015 17:40:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752158AbbHURk2 (ORCPT ); Fri, 21 Aug 2015 13:40:28 -0400 Received: from mail-wi0-f180.google.com ([209.85.212.180]:37736 "EHLO mail-wi0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752038AbbHURkT (ORCPT ); Fri, 21 Aug 2015 13:40:19 -0400 Received: by widdq5 with SMTP id dq5so21637493wid.0; Fri, 21 Aug 2015 10:40:17 -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=NNpSAr6WUTK6tzShTQhgPkSV0bpBDYar3LlsgIQcLTg=; b=CO3G6g57RcNPHFHD7wZclGRlZkIPh/w0jibHYRcZVJXqRCTSJFt+BPcajK1fCrt7q4 uII+Z1FUPj9vROVN7U9cVsrjMgQvo47MH/L1TeV0y7cySAeQz0RxndM2ArR+j9up10Ox wuzBmUuQUnup0mo504lQT2iAzIKnBD2FavgUAAFtYv21uojym01IRz7JtN1JKE/syd7P KvqVciykwnIe1y7dm5IEWK3F8lkdGpqolxIs7/Rt8X5IvJrb93r+HfL9HKZj7zxneJEC 6yFNzdjlTjgGfJzMP148TTs+w76gHwuJE5LB/2GjCpDY05bNX8C34ntRMMiVRDk6LhTl X/AQ== X-Received: by 10.194.179.103 with SMTP id df7mr18308203wjc.69.1440178817704; Fri, 21 Aug 2015 10:40:17 -0700 (PDT) Received: from ?IPv6:2003:62:5f33:d300:4526:b663:4b92:a3e2? (p200300625F33D3004526B6634B92A3E2.dip0.t-ipconnect.de. [2003:62:5f33:d300:4526:b663:4b92:a3e2]) by smtp.googlemail.com with ESMTPSA id l13sm10897238wjr.18.2015.08.21.10.40.16 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 21 Aug 2015 10:40:16 -0700 (PDT) Message-ID: <55D7608A.7010800@gmail.com> Date: Fri, 21 Aug 2015 19:31:54 +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 3/4 RESEND v2] spi: s3c64xx: simplify suspend / resume handlers Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Spam-Status: No, score=-7.6 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=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 The runtime PM suspend / resume handlers take care of the enabling/ disabling the clocks already. Therefore replace the duplicated clock handling with pm_runtime_force_suspend/resume. Signed-off-by: Heiner Kallweit Reviewed-by: Krzysztof Kozlowski --- Changed: - Replaced pm_runtime_suspend/resume calls with their .._force_.. equivalents. v2: - Added "Reviewed-by" drivers/spi/spi-s3c64xx.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/drivers/spi/spi-s3c64xx.c b/drivers/spi/spi-s3c64xx.c index edeac06..735b7f5 100644 --- a/drivers/spi/spi-s3c64xx.c +++ b/drivers/spi/spi-s3c64xx.c @@ -1246,10 +1246,9 @@ static int s3c64xx_spi_suspend(struct device *dev) if (ret) return ret; - if (!pm_runtime_suspended(dev)) { - clk_disable_unprepare(sdd->clk); - clk_disable_unprepare(sdd->src_clk); - } + ret = pm_runtime_force_suspend(dev); + if (ret < 0) + return ret; sdd->cur_speed = 0; /* Output Clock is stopped */ @@ -1261,14 +1260,14 @@ static int s3c64xx_spi_resume(struct device *dev) struct spi_master *master = dev_get_drvdata(dev); struct s3c64xx_spi_driver_data *sdd = spi_master_get_devdata(master); struct s3c64xx_spi_info *sci = sdd->cntrlr_info; + int ret; if (sci->cfg_gpio) sci->cfg_gpio(); - if (!pm_runtime_suspended(dev)) { - clk_prepare_enable(sdd->src_clk); - clk_prepare_enable(sdd->clk); - } + ret = pm_runtime_force_resume(dev); + if (ret < 0) + return ret; s3c64xx_spi_hwinit(sdd, sdd->port_id);