Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp3072185iog; Mon, 27 Jun 2022 08:33:49 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vywoAZHtLLTRqvLCbc6icgO1zusSgAXZ87knXGAB6SLY0H3G6cBWlWs8QjhLdgT/zpvNHm X-Received: by 2002:a63:680a:0:b0:40d:bb2:19f4 with SMTP id d10-20020a63680a000000b0040d0bb219f4mr13581869pgc.593.1656344029133; Mon, 27 Jun 2022 08:33:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656344029; cv=none; d=google.com; s=arc-20160816; b=TZY9AW7SC9V0nPdddl+kuXnGTWmH5owspekwNMFSaMEB8LfNu2Z0mGehZJLy/U/u+4 WHmlGtc+YVeEWwTuzXK5OdRaZDSUUxunfTlyGHfD8xRyeMf0PZT7BrytWx2Ymp9Yxk4W xw1ZmJjyVyl/pRPLwSBxlMT23/AqgXIKMj5ir/aXzFNr5DHmo1LNJAYH7bcSnUhfsLAg N6ivSxw336VIUyqobdNQ2/97q/kEfxOg6UpkhSf/BPgiPJsk9jUex7Ar7rfRaDSEltP+ wUir8hnJ9Q3et42dftZViYJBd21zaHiL6H5DZg1uGzxhIpzp+RQxat59ayOFtVsAIvCq tkQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=YasUUr5VVLTNXnWXpzlBAAbBrfET7InXBSGcMqJyUUE=; b=GqVC1INPczQfSehcpgkVWYSotGcze/t+hHEXoFpgXG4cMClEKfEQ2/58Bw0R2rsB1s O0Nlsl39dmyOiKGPyLDcMLKHJ3z5aXgOVNFi3xsiKqqRnmfRUJHXsapL69arRZOQzifs UDTbIdQtP8lB29Cx9qrO6KEoylubLw2x0GepTl3OLR0vzDu4dViuO1AC7O8TBsnoCVVv auxeNHx26N6Q9qG4WUJxK6t5g5FVZyzAicSY4jwlGWg7VFAe0gDafGH7iVojHjDlnZYu Z7PGGHVGa/lc0HlrupwjM85/wXjGOWCrOPpEMCfzEDr247rSkhcoSlWhDoJKR7hs+IkG E0zw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p10-20020a056a000a0a00b005255d5ad6e7si20865927pfh.305.2022.06.27.08.33.32; Mon, 27 Jun 2022 08:33:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238213AbiF0Pb3 (ORCPT + 99 others); Mon, 27 Jun 2022 11:31:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51082 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235959AbiF0Pb1 (ORCPT ); Mon, 27 Jun 2022 11:31:27 -0400 Received: from baptiste.telenet-ops.be (baptiste.telenet-ops.be [IPv6:2a02:1800:120:4::f00:13]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 202CD19C2B for ; Mon, 27 Jun 2022 08:31:24 -0700 (PDT) Received: from ramsan.of.borg ([84.195.186.194]) by baptiste.telenet-ops.be with bizsmtp id oFXH2700d4C55Sk01FXHZH; Mon, 27 Jun 2022 17:31:23 +0200 Received: from rox.of.borg ([192.168.97.57]) by ramsan.of.borg with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1o5qho-0014ya-WF; Mon, 27 Jun 2022 17:31:17 +0200 Received: from geert by rox.of.borg with local (Exim 4.93) (envelope-from ) id 1o5qho-004jEZ-GC; Mon, 27 Jun 2022 17:31:16 +0200 From: Geert Uytterhoeven To: Vignesh Raghavendra , Sergey Shtylyov , Krzysztof Kozlowski , Wolfram Sang , Lad Prabhakar , Miquel Raynal , Richard Weinberger Cc: Mark Brown , linux-mtd@lists.infradead.org, linux-renesas-soc@vger.kernel.org, linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH 3/7] memory: renesas-rpc-if: Improve Runtime PM handling Date: Mon, 27 Jun 2022 17:31:10 +0200 Message-Id: <88fa4252bb685e9a9eb6e70fe2df32bb6243d405.1656341824.git.geert+renesas@glider.be> X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.4 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Convert from the deprecated pm_runtime_get_sync() to the new pm_runtime_resume_and_get(), and add error checking. Signed-off-by: Geert Uytterhoeven --- drivers/memory/renesas-rpc-if.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/drivers/memory/renesas-rpc-if.c b/drivers/memory/renesas-rpc-if.c index 2421a820e3c5880c..55dbb3854b09ad43 100644 --- a/drivers/memory/renesas-rpc-if.c +++ b/drivers/memory/renesas-rpc-if.c @@ -300,12 +300,13 @@ static void rpcif_rzg2l_timing_adjust_sdr(struct rpcif *rpc) int rpcif_hw_init(struct rpcif *rpc, bool hyperflash) { u32 dummy; + int ret; - pm_runtime_get_sync(rpc->dev); + ret = pm_runtime_resume_and_get(rpc->dev); + if (ret) + return ret; if (rpc->type == RPCIF_RZ_G2L) { - int ret; - ret = reset_control_reset(rpc->rstc); if (ret) return ret; @@ -469,7 +470,9 @@ int rpcif_manual_xfer(struct rpcif *rpc) u32 smenr, smcr, pos = 0, max = rpc->bus_size == 2 ? 8 : 4; int ret = 0; - pm_runtime_get_sync(rpc->dev); + ret = pm_runtime_resume_and_get(rpc->dev); + if (ret < 0) + return ret; regmap_update_bits(rpc->regmap, RPCIF_PHYCNT, RPCIF_PHYCNT_CAL, RPCIF_PHYCNT_CAL); @@ -636,11 +639,14 @@ ssize_t rpcif_dirmap_read(struct rpcif *rpc, u64 offs, size_t len, void *buf) { loff_t from = offs & (rpc->size - 1); size_t size = rpc->size - from; + int ret; if (len > size) len = size; - pm_runtime_get_sync(rpc->dev); + ret = pm_runtime_resume_and_get(rpc->dev); + if (ret < 0) + return ret; regmap_update_bits(rpc->regmap, RPCIF_CMNCR, RPCIF_CMNCR_MD, 0); regmap_write(rpc->regmap, RPCIF_DRCR, 0); -- 2.25.1