From patchwork Tue Nov 24 11:25:48 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Prabhakar X-Patchwork-Id: 11928027 X-Patchwork-Delegate: geert@linux-m68k.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C506FC6379D for ; Tue, 24 Nov 2020 11:26:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8F23020872 for ; Tue, 24 Nov 2020 11:26:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732664AbgKXL0K (ORCPT ); Tue, 24 Nov 2020 06:26:10 -0500 Received: from relmlor1.renesas.com ([210.160.252.171]:44147 "EHLO relmlie5.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1732658AbgKXL0J (ORCPT ); Tue, 24 Nov 2020 06:26:09 -0500 X-IronPort-AV: E=Sophos;i="5.78,366,1599490800"; d="scan'208";a="63718439" Received: from unknown (HELO relmlir6.idc.renesas.com) ([10.200.68.152]) by relmlie5.idc.renesas.com with ESMTP; 24 Nov 2020 20:26:08 +0900 Received: from localhost.localdomain (unknown [10.226.36.204]) by relmlir6.idc.renesas.com (Postfix) with ESMTP id 6AE444362273; Tue, 24 Nov 2020 20:26:06 +0900 (JST) From: Lad Prabhakar To: Sergei Shtylyov , Krzysztof Kozlowski , Philipp Zabel , Jiri Kosina , Mark Brown Cc: linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org, Biju Das , Prabhakar , Lad Prabhakar , stable@vger.kernel.org Subject: [PATCH 1/5] memory: renesas-rpc-if: Return correct value to the caller of rpcif_manual_xfer() Date: Tue, 24 Nov 2020 11:25:48 +0000 Message-Id: <20201124112552.26377-2-prabhakar.mahadev-lad.rj@bp.renesas.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20201124112552.26377-1-prabhakar.mahadev-lad.rj@bp.renesas.com> References: <20201124112552.26377-1-prabhakar.mahadev-lad.rj@bp.renesas.com> Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org In the error path of rpcif_manual_xfer() the value of ret is overwritten by value returned by reset_control_reset() function and thus returning incorrect value to the caller. This patch makes sure the correct value is returned to the caller of rpcif_manual_xfer() by dropping the overwrite of ret in error path. Also now we ignore the value returned by reset_control_reset() in the error path and instead print a error message when it fails. Fixes: ca7d8b980b67f ("memory: add Renesas RPC-IF driver") Reported-by: Pavel Machek Signed-off-by: Lad Prabhakar Cc: stable@vger.kernel.org Reviewed-by: Sergei Shtylyov --- drivers/memory/renesas-rpc-if.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/memory/renesas-rpc-if.c b/drivers/memory/renesas-rpc-if.c index f2a33a1af836..69f2e2b4cd50 100644 --- a/drivers/memory/renesas-rpc-if.c +++ b/drivers/memory/renesas-rpc-if.c @@ -508,7 +508,8 @@ int rpcif_manual_xfer(struct rpcif *rpc) return ret; err_out: - ret = reset_control_reset(rpc->rstc); + if (reset_control_reset(rpc->rstc)) + dev_err(rpc->dev, "Failed to reset HW\n"); rpcif_hw_init(rpc, rpc->bus_size == 2); goto exit; } From patchwork Tue Nov 24 11:25:49 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Prabhakar X-Patchwork-Id: 11928025 X-Patchwork-Delegate: geert@linux-m68k.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id AE78EC2D0E4 for ; Tue, 24 Nov 2020 11:26:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 67A672158C for ; Tue, 24 Nov 2020 11:26:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732715AbgKXL0M (ORCPT ); Tue, 24 Nov 2020 06:26:12 -0500 Received: from relmlor1.renesas.com ([210.160.252.171]:44147 "EHLO relmlie5.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1732658AbgKXL0L (ORCPT ); Tue, 24 Nov 2020 06:26:11 -0500 X-IronPort-AV: E=Sophos;i="5.78,366,1599490800"; d="scan'208";a="63718445" Received: from unknown (HELO relmlir6.idc.renesas.com) ([10.200.68.152]) by relmlie5.idc.renesas.com with ESMTP; 24 Nov 2020 20:26:11 +0900 Received: from localhost.localdomain (unknown [10.226.36.204]) by relmlir6.idc.renesas.com (Postfix) with ESMTP id 08B454362275; Tue, 24 Nov 2020 20:26:08 +0900 (JST) From: Lad Prabhakar To: Sergei Shtylyov , Krzysztof Kozlowski , Philipp Zabel , Jiri Kosina , Mark Brown Cc: linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org, Biju Das , Prabhakar , Lad Prabhakar Subject: [PATCH 2/5] memory: renesas-rpc-if: Make rpcif_enable/disable_rpm() as static inline Date: Tue, 24 Nov 2020 11:25:49 +0000 Message-Id: <20201124112552.26377-3-prabhakar.mahadev-lad.rj@bp.renesas.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20201124112552.26377-1-prabhakar.mahadev-lad.rj@bp.renesas.com> References: <20201124112552.26377-1-prabhakar.mahadev-lad.rj@bp.renesas.com> Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org Define rpcif_enable_rpm() and rpcif_disable_rpm() as static inline in the header instead of exporting it. Suggested-by: Pavel Machek Signed-off-by: Lad Prabhakar --- drivers/memory/renesas-rpc-if.c | 13 ------------- include/memory/renesas-rpc-if.h | 13 +++++++++++-- 2 files changed, 11 insertions(+), 15 deletions(-) diff --git a/drivers/memory/renesas-rpc-if.c b/drivers/memory/renesas-rpc-if.c index 69f2e2b4cd50..c5b5691503d7 100644 --- a/drivers/memory/renesas-rpc-if.c +++ b/drivers/memory/renesas-rpc-if.c @@ -12,7 +12,6 @@ #include #include #include -#include #include #include @@ -204,18 +203,6 @@ int rpcif_sw_init(struct rpcif *rpc, struct device *dev) } EXPORT_SYMBOL(rpcif_sw_init); -void rpcif_enable_rpm(struct rpcif *rpc) -{ - pm_runtime_enable(rpc->dev); -} -EXPORT_SYMBOL(rpcif_enable_rpm); - -void rpcif_disable_rpm(struct rpcif *rpc) -{ - pm_runtime_put_sync(rpc->dev); -} -EXPORT_SYMBOL(rpcif_disable_rpm); - void rpcif_hw_init(struct rpcif *rpc, bool hyperflash) { u32 dummy; diff --git a/include/memory/renesas-rpc-if.h b/include/memory/renesas-rpc-if.h index 9ad136682c47..b8c7cc63065f 100644 --- a/include/memory/renesas-rpc-if.h +++ b/include/memory/renesas-rpc-if.h @@ -10,6 +10,7 @@ #ifndef __RENESAS_RPC_IF_H #define __RENESAS_RPC_IF_H +#include #include enum rpcif_data_dir { @@ -77,11 +78,19 @@ struct rpcif { int rpcif_sw_init(struct rpcif *rpc, struct device *dev); void rpcif_hw_init(struct rpcif *rpc, bool hyperflash); -void rpcif_enable_rpm(struct rpcif *rpc); -void rpcif_disable_rpm(struct rpcif *rpc); void rpcif_prepare(struct rpcif *rpc, const struct rpcif_op *op, u64 *offs, size_t *len); int rpcif_manual_xfer(struct rpcif *rpc); ssize_t rpcif_dirmap_read(struct rpcif *rpc, u64 offs, size_t len, void *buf); +static inline void rpcif_enable_rpm(struct rpcif *rpc) +{ + pm_runtime_enable(rpc->dev); +} + +static inline void rpcif_disable_rpm(struct rpcif *rpc) +{ + pm_runtime_put_sync(rpc->dev); +} + #endif // __RENESAS_RPC_IF_H From patchwork Tue Nov 24 11:25:50 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Prabhakar X-Patchwork-Id: 11928033 X-Patchwork-Delegate: geert@linux-m68k.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7EFB3C71155 for ; Tue, 24 Nov 2020 11:26:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4B33F2075A for ; Tue, 24 Nov 2020 11:26:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732765AbgKXL0P (ORCPT ); Tue, 24 Nov 2020 06:26:15 -0500 Received: from relmlor2.renesas.com ([210.160.252.172]:10210 "EHLO relmlie6.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1732749AbgKXL0O (ORCPT ); Tue, 24 Nov 2020 06:26:14 -0500 X-IronPort-AV: E=Sophos;i="5.78,366,1599490800"; d="scan'208";a="63502457" Received: from unknown (HELO relmlir6.idc.renesas.com) ([10.200.68.152]) by relmlie6.idc.renesas.com with ESMTP; 24 Nov 2020 20:26:13 +0900 Received: from localhost.localdomain (unknown [10.226.36.204]) by relmlir6.idc.renesas.com (Postfix) with ESMTP id 6B37C4362272; Tue, 24 Nov 2020 20:26:11 +0900 (JST) From: Lad Prabhakar To: Sergei Shtylyov , Krzysztof Kozlowski , Philipp Zabel , Jiri Kosina , Mark Brown Cc: linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org, Biju Das , Prabhakar , Lad Prabhakar Subject: [PATCH 3/5] memory: renesas-rpc-if: Export symbols as GPL Date: Tue, 24 Nov 2020 11:25:50 +0000 Message-Id: <20201124112552.26377-4-prabhakar.mahadev-lad.rj@bp.renesas.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20201124112552.26377-1-prabhakar.mahadev-lad.rj@bp.renesas.com> References: <20201124112552.26377-1-prabhakar.mahadev-lad.rj@bp.renesas.com> Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org Renesas RPC-IF driver is licensed under GPL2.0, to be in sync export the symbols as GPL. Suggested-by: Pavel Machek Signed-off-by: Lad Prabhakar Reviewed-by: Sergei Shtylyov --- drivers/memory/renesas-rpc-if.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/memory/renesas-rpc-if.c b/drivers/memory/renesas-rpc-if.c index c5b5691503d7..f5cbc762fda7 100644 --- a/drivers/memory/renesas-rpc-if.c +++ b/drivers/memory/renesas-rpc-if.c @@ -201,7 +201,7 @@ int rpcif_sw_init(struct rpcif *rpc, struct device *dev) return PTR_ERR_OR_ZERO(rpc->rstc); } -EXPORT_SYMBOL(rpcif_sw_init); +EXPORT_SYMBOL_GPL(rpcif_sw_init); void rpcif_hw_init(struct rpcif *rpc, bool hyperflash) { @@ -249,7 +249,7 @@ void rpcif_hw_init(struct rpcif *rpc, bool hyperflash) rpc->bus_size = hyperflash ? 2 : 1; } -EXPORT_SYMBOL(rpcif_hw_init); +EXPORT_SYMBOL_GPL(rpcif_hw_init); static int wait_msg_xfer_end(struct rpcif *rpc) { @@ -358,7 +358,7 @@ void rpcif_prepare(struct rpcif *rpc, const struct rpcif_op *op, u64 *offs, RPCIF_SMENR_SPIDB(rpcif_bit_size(op->data.buswidth)); } } -EXPORT_SYMBOL(rpcif_prepare); +EXPORT_SYMBOL_GPL(rpcif_prepare); int rpcif_manual_xfer(struct rpcif *rpc) { @@ -500,7 +500,7 @@ int rpcif_manual_xfer(struct rpcif *rpc) rpcif_hw_init(rpc, rpc->bus_size == 2); goto exit; } -EXPORT_SYMBOL(rpcif_manual_xfer); +EXPORT_SYMBOL_GPL(rpcif_manual_xfer); ssize_t rpcif_dirmap_read(struct rpcif *rpc, u64 offs, size_t len, void *buf) { @@ -529,7 +529,7 @@ ssize_t rpcif_dirmap_read(struct rpcif *rpc, u64 offs, size_t len, void *buf) return len; } -EXPORT_SYMBOL(rpcif_dirmap_read); +EXPORT_SYMBOL_GPL(rpcif_dirmap_read); static int rpcif_probe(struct platform_device *pdev) { From patchwork Tue Nov 24 11:25:51 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Prabhakar X-Patchwork-Id: 11928029 X-Patchwork-Delegate: geert@linux-m68k.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DE49BC64E7A for ; Tue, 24 Nov 2020 11:26:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8C5A02073C for ; Tue, 24 Nov 2020 11:26:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732749AbgKXL0Q (ORCPT ); Tue, 24 Nov 2020 06:26:16 -0500 Received: from relmlor1.renesas.com ([210.160.252.171]:44147 "EHLO relmlie5.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1732791AbgKXL0Q (ORCPT ); Tue, 24 Nov 2020 06:26:16 -0500 X-IronPort-AV: E=Sophos;i="5.78,366,1599490800"; d="scan'208";a="63718454" Received: from unknown (HELO relmlir6.idc.renesas.com) ([10.200.68.152]) by relmlie5.idc.renesas.com with ESMTP; 24 Nov 2020 20:26:15 +0900 Received: from localhost.localdomain (unknown [10.226.36.204]) by relmlir6.idc.renesas.com (Postfix) with ESMTP id D1F074362273; Tue, 24 Nov 2020 20:26:13 +0900 (JST) From: Lad Prabhakar To: Sergei Shtylyov , Krzysztof Kozlowski , Philipp Zabel , Jiri Kosina , Mark Brown Cc: linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org, Biju Das , Prabhakar , Lad Prabhakar Subject: [PATCH 4/5] memory: renesas-rpc-if: Avoid use of C++ style comments Date: Tue, 24 Nov 2020 11:25:51 +0000 Message-Id: <20201124112552.26377-5-prabhakar.mahadev-lad.rj@bp.renesas.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20201124112552.26377-1-prabhakar.mahadev-lad.rj@bp.renesas.com> References: <20201124112552.26377-1-prabhakar.mahadev-lad.rj@bp.renesas.com> Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org Replace C++ style comment with C style. While at it also replace the tab with a space between struct and struct name. Suggested-by: Pavel Machek Signed-off-by: Lad Prabhakar --- include/memory/renesas-rpc-if.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/memory/renesas-rpc-if.h b/include/memory/renesas-rpc-if.h index b8c7cc63065f..30ea6bd969b4 100644 --- a/include/memory/renesas-rpc-if.h +++ b/include/memory/renesas-rpc-if.h @@ -19,7 +19,7 @@ enum rpcif_data_dir { RPCIF_DATA_OUT, }; -struct rpcif_op { +struct rpcif_op { struct { u8 buswidth; u8 opcode; @@ -57,7 +57,7 @@ struct rpcif_op { } data; }; -struct rpcif { +struct rpcif { struct device *dev; void __iomem *dirmap; struct regmap *regmap; @@ -93,4 +93,4 @@ static inline void rpcif_disable_rpm(struct rpcif *rpc) pm_runtime_put_sync(rpc->dev); } -#endif // __RENESAS_RPC_IF_H +#endif /* __RENESAS_RPC_IF_H */ From patchwork Tue Nov 24 11:25:52 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Prabhakar X-Patchwork-Id: 11928031 X-Patchwork-Delegate: geert@linux-m68k.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 37DBEC56202 for ; Tue, 24 Nov 2020 11:26:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E2EEC2075A for ; Tue, 24 Nov 2020 11:26:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732820AbgKXL0T (ORCPT ); Tue, 24 Nov 2020 06:26:19 -0500 Received: from relmlor2.renesas.com ([210.160.252.172]:10210 "EHLO relmlie6.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1732791AbgKXL0T (ORCPT ); Tue, 24 Nov 2020 06:26:19 -0500 X-IronPort-AV: E=Sophos;i="5.78,366,1599490800"; d="scan'208";a="63502464" Received: from unknown (HELO relmlir6.idc.renesas.com) ([10.200.68.152]) by relmlie6.idc.renesas.com with ESMTP; 24 Nov 2020 20:26:18 +0900 Received: from localhost.localdomain (unknown [10.226.36.204]) by relmlir6.idc.renesas.com (Postfix) with ESMTP id 3F9774362272; Tue, 24 Nov 2020 20:26:16 +0900 (JST) From: Lad Prabhakar To: Sergei Shtylyov , Krzysztof Kozlowski , Philipp Zabel , Jiri Kosina , Mark Brown Cc: linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org, Biju Das , Prabhakar , Lad Prabhakar , stable@vger.kernel.org Subject: [PATCH 5/5] memory: renesas-rpc-if: Fix a reference leak in rpcif_probe() Date: Tue, 24 Nov 2020 11:25:52 +0000 Message-Id: <20201124112552.26377-6-prabhakar.mahadev-lad.rj@bp.renesas.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20201124112552.26377-1-prabhakar.mahadev-lad.rj@bp.renesas.com> References: <20201124112552.26377-1-prabhakar.mahadev-lad.rj@bp.renesas.com> Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org Release the node reference by calling of_node_put(flash) in the probe. Fixes: ca7d8b980b67f ("memory: add Renesas RPC-IF driver") Reported-by: Pavel Machek Signed-off-by: Lad Prabhakar Cc: stable@vger.kernel.org Reviewed-by: Sergei Shtylyov --- drivers/memory/renesas-rpc-if.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/memory/renesas-rpc-if.c b/drivers/memory/renesas-rpc-if.c index f5cbc762fda7..99633986ffda 100644 --- a/drivers/memory/renesas-rpc-if.c +++ b/drivers/memory/renesas-rpc-if.c @@ -548,9 +548,11 @@ static int rpcif_probe(struct platform_device *pdev) } else if (of_device_is_compatible(flash, "cfi-flash")) { name = "rpc-if-hyperflash"; } else { + of_node_put(flash); dev_warn(&pdev->dev, "unknown flash type\n"); return -ENODEV; } + of_node_put(flash); vdev = platform_device_alloc(name, pdev->id); if (!vdev)