From patchwork Thu Aug 20 20:07:18 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heiner Kallweit X-Patchwork-Id: 7046941 Return-Path: X-Original-To: patchwork-linux-spi@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 41F929F373 for ; Thu, 20 Aug 2015 20:13:49 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 77B2320451 for ; Thu, 20 Aug 2015 20:13:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id ABB3D20453 for ; Thu, 20 Aug 2015 20:13:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752467AbbHTUNo (ORCPT ); Thu, 20 Aug 2015 16:13:44 -0400 Received: from mail-wi0-f173.google.com ([209.85.212.173]:35529 "EHLO mail-wi0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752302AbbHTUNo (ORCPT ); Thu, 20 Aug 2015 16:13:44 -0400 Received: by wicne3 with SMTP id ne3so155152062wic.0; Thu, 20 Aug 2015 13:13:42 -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=Mk1MSYF4DT4CYQBNvF32bx/sw6ZlofF47An3uuTkUgA=; b=xGN/Sv7mBQajYXY1pvs+wRGL4gpDnQOg0P/Yfk8v/r5ZDei80UiTsyPe7ufOEUlWrv 9M3lgxgMbyXK+W9IQLdfb+T0EDVjagMEkFIcbxBUW5x50xHIo1PZjItN754I4SL9w7R2 YHKYUIClNmlP6X/P8UGw70Uk/mX4G59arhZQLQSh1zAwOisuw1XXrxLAYtCYq90uwf3M lMi1Th8xna4zCHCQ70osWfS3I8g3bD4/NYTWE58BYkE+7BdiphrGDO5UmSe170KM8Gtu cCEXjKVGVluwInI5Lvc4kaemfmuPsGZnarxA3gRluWSynpRc+R68XZDj7qGGEORQBXUx RTxQ== X-Received: by 10.194.86.72 with SMTP id n8mr9496615wjz.119.1440101622806; Thu, 20 Aug 2015 13:13:42 -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 eu2sm7565486wic.8.2015.08.20.13.13.41 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 20 Aug 2015 13:13:42 -0700 (PDT) Message-ID: <55D63376.5070607@gmail.com> Date: Thu, 20 Aug 2015 22:07:18 +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] spi: s3c64xx: simplify suspend / resume handlers 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 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. 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);