Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp234511iog; Fri, 17 Jun 2022 02:35:47 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vDqmYQOPhbegnX6vVxtHpiCYQASDdBAIpdjZqid0/mPpa9x/vNq+qbf42anhf8BwYwKqPo X-Received: by 2002:a63:2213:0:b0:3fe:7f8:c917 with SMTP id i19-20020a632213000000b003fe07f8c917mr8350911pgi.406.1655458546815; Fri, 17 Jun 2022 02:35:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655458546; cv=none; d=google.com; s=arc-20160816; b=g7Na4AweJaBQvRHV1EP+pja8sGZdebhD/GUmlLGtZtq20Xh9HP7rZOJigDbPw17y8f aYgCmyuXZ20wSLYhf+UyxcZW9mHcApDWj2/Gd2cYBS4H/4lGhHUQDqhqpQIA95Ed584N ZllGy4wLw5uVYXBfsyGmT5C0RYk9mWQpyfVi79J8DXLTQOrMg0J+4ZbHMnv4rQ1KNBKj WsIAkJH0iKSk3fza7wq27ErltKp5GxEcvonrhGc1thCvJfiqeAfGAJsyaCaxaXk/mN4W 8vyOkFVAEkcy83pKEowzZ62W7B82uG6D+0wpOrSz8uNdxYflwOplVAwG8wiCbEg5S8wr CeLg== 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 :message-id:date:subject:cc:to:from; bh=Xq5CQPjAY/XZXLS22on/E/mOaK2UIfjAaLs0xegjI7Q=; b=nr53u8Ryq0AlrZUoN3QlAMqPAcXwt1vx6WjxOkJ2S4rVxdtAurjV3n33GIneVDIWew ijRR0xPxqy/5gfdtTTyFeQskYlel3arxoXYVl8gcFeCcHvGj7S+NU9wT+wNswByJTtwF OIN7mRmGu5Bl5k+KqK/ot/dVUTa+vwLhQc7aPAU1x9G7nhglFBAM3dKl4Ni/Jxsdyah6 J61eQrh6AiVm0cq5wVvqzC1PVk49qwpt2GySwJ0E6QCfNmATnN0dTgwI8Akk/tbAh7oh gKJrBi9qDXRpuIAArNmBq9xpJOrPwyDV1pSkXP4RnbTfFhJ1oXEMZ1wjgCV/56ZO0RfC eZaA== 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 t14-20020a170902b20e00b00163daf783d9si4748798plr.555.2022.06.17.02.35.26; Fri, 17 Jun 2022 02:35:46 -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 S1380246AbiFQJ1C (ORCPT + 99 others); Fri, 17 Jun 2022 05:27:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44880 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1380820AbiFQJ1A (ORCPT ); Fri, 17 Jun 2022 05:27:00 -0400 Received: from laurent.telenet-ops.be (laurent.telenet-ops.be [IPv6:2a02:1800:110:4::f00:19]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4569863BDC for ; Fri, 17 Jun 2022 02:26:59 -0700 (PDT) Received: from ramsan.of.borg ([IPv6:2a02:1810:ac12:ed30:100b:81f8:e79f:4643]) by laurent.telenet-ops.be with bizsmtp id k9Su270072Lt3zn019SunH; Fri, 17 Jun 2022 11:26:57 +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 1o28Fh-004P52-Ja; Fri, 17 Jun 2022 11:26:53 +0200 Received: from geert by rox.of.borg with local (Exim 4.93) (envelope-from ) id 1o28Fg-008ty3-UY; Fri, 17 Jun 2022 11:26:52 +0200 From: Geert Uytterhoeven To: Vignesh Raghavendra , Miquel Raynal , Richard Weinberger , Sergey Shtylyov Cc: Wolfram Sang , Lad Prabhakar , Biju Das , Krzysztof Kozlowski , linux-renesas-soc@vger.kernel.org, linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH v2] mtd: hyperbus: rpc-if: Fix RPM imbalance in probe error path Date: Fri, 17 Jun 2022 11:26:51 +0200 Message-Id: X-Mailer: git-send-email 2.25.1 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=ham 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 If rpcif_hw_init() fails, Runtime PM is left enabled. Fixes: b04cc0d912eb80d3 ("memory: renesas-rpc-if: Add support for RZ/G2L") Signed-off-by: Geert Uytterhoeven Reviewed-by: Wolfram Sang Reviewed-by: Lad Prabhakar --- v2: - Add Reviewed-by. --- drivers/mtd/hyperbus/rpc-if.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/mtd/hyperbus/rpc-if.c b/drivers/mtd/hyperbus/rpc-if.c index 6e08ec1d4f098c80..b70d259e48a7c728 100644 --- a/drivers/mtd/hyperbus/rpc-if.c +++ b/drivers/mtd/hyperbus/rpc-if.c @@ -134,7 +134,7 @@ static int rpcif_hb_probe(struct platform_device *pdev) error = rpcif_hw_init(&hyperbus->rpc, true); if (error) - return error; + goto out_disable_rpm; hyperbus->hbdev.map.size = hyperbus->rpc.size; hyperbus->hbdev.map.virt = hyperbus->rpc.dirmap; @@ -145,8 +145,12 @@ static int rpcif_hb_probe(struct platform_device *pdev) hyperbus->hbdev.np = of_get_next_child(pdev->dev.parent->of_node, NULL); error = hyperbus_register_device(&hyperbus->hbdev); if (error) - rpcif_disable_rpm(&hyperbus->rpc); + goto out_disable_rpm; + + return 0; +out_disable_rpm: + rpcif_disable_rpm(&hyperbus->rpc); return error; } -- 2.25.1