From patchwork Wed Mar 5 16:37:50 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabrizio Castro X-Patchwork-Id: 14002976 X-Patchwork-Delegate: geert@linux-m68k.org Received: from relmlie6.idc.renesas.com (relmlor2.renesas.com [210.160.252.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6F6951AAE2E; Wed, 5 Mar 2025 16:38:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=210.160.252.172 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741192687; cv=none; b=VGQBwevjiSIqPxkBOFjyxQZgKznlkvCpzyscGxDYp5V7GYxFm5EYP1n+UrgRDDWIR+O3aWUGbalBGcMBXPJS8q4BBLB/1LvfW2X0EGUmNN55daVEvMFxNvK1fHOGfaPTkyUDTC0iRzKRtlYLfoqaIpSOrnG+qyYPk6lCAfxLqVQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741192687; c=relaxed/simple; bh=k2M3/q/adRFyhot2mgf/CMtxVEr7FsGvmTY6Z+hgrGk=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=udL2jY7tr1v0DiZjsZU0XogNePoWLkdwgfxYGNzJSb8+YXwvSGs6P51mTD8KUhGC9HfCt5fjbloXb3QrpazN0T6dctYnCUpJ7tJY+ZrTLh4fLGBrpJY6qL/yF7JTftI4reC7lTNtgB6OkLumnFT4vXy4gki7cIURqXzgBSX4ers= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=renesas.com; spf=pass smtp.mailfrom=renesas.com; arc=none smtp.client-ip=210.160.252.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=renesas.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=renesas.com X-CSE-ConnectionGUID: ny+nymeWSVWinr3KFTNOpw== X-CSE-MsgGUID: ktDably4RyCY4HY6FxBxvA== Received: from unknown (HELO relmlir5.idc.renesas.com) ([10.200.68.151]) by relmlie6.idc.renesas.com with ESMTP; 06 Mar 2025 01:38:03 +0900 Received: from mulinux.home (unknown [10.226.92.17]) by relmlir5.idc.renesas.com (Postfix) with ESMTP id B365D4017975; Thu, 6 Mar 2025 01:38:00 +0900 (JST) From: Fabrizio Castro To: Linus Walleij , Bartosz Golaszewski , Geert Uytterhoeven Cc: Fabrizio Castro , Simon Horman , Laurent Pinchart , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, Biju Das , Lad Prabhakar , linux-renesas-soc@vger.kernel.org Subject: [PATCH 1/4] gpio: rcar: Fix missing of_node_put() call Date: Wed, 5 Mar 2025 16:37:50 +0000 Message-Id: <20250305163753.34913-2-fabrizio.castro.jz@renesas.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250305163753.34913-1-fabrizio.castro.jz@renesas.com> References: <20250305163753.34913-1-fabrizio.castro.jz@renesas.com> Precedence: bulk X-Mailing-List: linux-renesas-soc@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 of_parse_phandle_with_fixed_args() requires its caller to call into of_node_put() on the node pointer from the output structure, but such a call is currently missing. Call into of_node_put() to rectify that. Fixes: 159f8a0209af ("gpio-rcar: Add DT support") Signed-off-by: Fabrizio Castro Reviewed-by: Lad Prabhakar Reviewed-by: Geert Uytterhoeven --- drivers/gpio/gpio-rcar.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/gpio/gpio-rcar.c b/drivers/gpio/gpio-rcar.c index 2ecee3269a0c..7208739cd2d4 100644 --- a/drivers/gpio/gpio-rcar.c +++ b/drivers/gpio/gpio-rcar.c @@ -468,7 +468,12 @@ static int gpio_rcar_parse_dt(struct gpio_rcar_priv *p, unsigned int *npins) p->info = *info; ret = of_parse_phandle_with_fixed_args(np, "gpio-ranges", 3, 0, &args); - *npins = ret == 0 ? args.args[2] : RCAR_MAX_GPIO_PER_BANK; + if (ret) { + *npins = RCAR_MAX_GPIO_PER_BANK; + } else { + *npins = args.args[2]; + of_node_put(args.np); + } if (*npins == 0 || *npins > RCAR_MAX_GPIO_PER_BANK) { dev_warn(p->dev, "Invalid number of gpio lines %u, using %u\n", From patchwork Wed Mar 5 16:37:51 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabrizio Castro X-Patchwork-Id: 14002977 X-Patchwork-Delegate: geert@linux-m68k.org Received: from relmlie5.idc.renesas.com (relmlor1.renesas.com [210.160.252.171]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3BAAA24E013; Wed, 5 Mar 2025 16:38:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=210.160.252.171 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741192690; cv=none; b=DyPFzhACJD4k8h+diqHPuxM0qoo/TPMppo0TOmETnogTtnF05sXZqfILyG4lwr4qPtZ+bttnceYqJpeul2LqC1YeQxuOT/D1tbYdtWNQwhZqJib4gR9Z67VN3CywkGujdeiniMEr5sp9Iez7pTVswtZl0FC7oS92G2mSbmL5+ug= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741192690; c=relaxed/simple; bh=4IbP09lBVQfq6U5X9J3XqAo4agzaWXLdUAtswp7Yiuo=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=mCeuXvsnqGfFYds3nWzCizI8bR/zaVw9rJP0j9mPbFq8mPfvvhusb4wEvVMU5tcSZGFFVpbZaDMQIn/fNEGJtFUiXxjebGlpYfgdH/Vbh3UnluZl97b0n29IlWANv5PpoMdYxoDwXaDeXzkZzMU6AeYGxyabGOo+cGQli8BoSmE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=renesas.com; spf=pass smtp.mailfrom=renesas.com; arc=none smtp.client-ip=210.160.252.171 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=renesas.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=renesas.com X-CSE-ConnectionGUID: CoI9aXoGTr6l1yhmeI41fQ== X-CSE-MsgGUID: 93mWPgOaRPuHmZg2Ai22TA== Received: from unknown (HELO relmlir5.idc.renesas.com) ([10.200.68.151]) by relmlie5.idc.renesas.com with ESMTP; 06 Mar 2025 01:38:06 +0900 Received: from mulinux.home (unknown [10.226.92.17]) by relmlir5.idc.renesas.com (Postfix) with ESMTP id 6F309400F792; Thu, 6 Mar 2025 01:38:04 +0900 (JST) From: Fabrizio Castro To: Linus Walleij , Geert Uytterhoeven Cc: Fabrizio Castro , Lad Prabhakar , Biju Das , linux-renesas-soc@vger.kernel.org, linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/4] pinctrl: renesas: rzg2l: Fix missing of_node_put() call Date: Wed, 5 Mar 2025 16:37:51 +0000 Message-Id: <20250305163753.34913-3-fabrizio.castro.jz@renesas.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250305163753.34913-1-fabrizio.castro.jz@renesas.com> References: <20250305163753.34913-1-fabrizio.castro.jz@renesas.com> Precedence: bulk X-Mailing-List: linux-renesas-soc@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 of_parse_phandle_with_fixed_args() requires its caller to call into of_node_put() on the node pointer from the output structure, but such a call is currently missing. Call into of_node_put() to rectify that. Fixes: c4c4637eb57f ("pinctrl: renesas: Add RZ/G2L pin and gpio controller driver") Signed-off-by: Fabrizio Castro Reviewed-by: Lad Prabhakar Reviewed-by: Geert Uytterhoeven --- drivers/pinctrl/renesas/pinctrl-rzg2l.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/pinctrl/renesas/pinctrl-rzg2l.c b/drivers/pinctrl/renesas/pinctrl-rzg2l.c index 9280bc37a623..c72e250f4a15 100644 --- a/drivers/pinctrl/renesas/pinctrl-rzg2l.c +++ b/drivers/pinctrl/renesas/pinctrl-rzg2l.c @@ -2763,6 +2763,8 @@ static int rzg2l_gpio_register(struct rzg2l_pinctrl *pctrl) if (ret) return dev_err_probe(pctrl->dev, ret, "Unable to parse gpio-ranges\n"); + of_node_put(of_args.np); + if (of_args.args[0] != 0 || of_args.args[1] != 0 || of_args.args[2] != pctrl->data->n_port_pins) return dev_err_probe(pctrl->dev, -EINVAL, From patchwork Wed Mar 5 16:37:52 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabrizio Castro X-Patchwork-Id: 14002978 X-Patchwork-Delegate: geert@linux-m68k.org Received: from relmlie5.idc.renesas.com (relmlor1.renesas.com [210.160.252.171]) by smtp.subspace.kernel.org (Postfix) with ESMTP id EC51719F436; Wed, 5 Mar 2025 16:38:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=210.160.252.171 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741192693; cv=none; b=aS36xtqHF2b2Ug3WwPxlGZddd7MfEXAk+023uKWpUVZ0TLJukEa9KRsceEc5rtOHzjPCDzwNLXz+f2FlKUh04gEgSeggPsLVYwttxLsXLXtvujCf4G6sOQ4kz4y7zHIDYugGj0vI9vED3GrF1T2wOwsgcjkaztZBDxWao7xnoSM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741192693; c=relaxed/simple; bh=mvze+eKfiyMF8l1PYJClq41NmvCIBsCRoIAodTUVeSc=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=rvdJBQQIMbyTlOcVPk+TqoqjS5JPfwOIqK/o5f9D3pfNt2cSy7oVjthT5B8M6nkkVYHiSuI5PZEHEnJ9H8VqImtEmErXOZKtCW/kQ2rV36IELHcggjW7Oc/Psx/tAGanB0YmOiAS3oWKyHtzfvrMKF0mFPMLM8rRiITJYLxdR1Y= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=renesas.com; spf=pass smtp.mailfrom=renesas.com; arc=none smtp.client-ip=210.160.252.171 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=renesas.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=renesas.com X-CSE-ConnectionGUID: TKW+x/jaRSGwVyK5CDZVuQ== X-CSE-MsgGUID: WP+GKewyT6qPahq7OmtlCQ== Received: from unknown (HELO relmlir5.idc.renesas.com) ([10.200.68.151]) by relmlie5.idc.renesas.com with ESMTP; 06 Mar 2025 01:38:09 +0900 Received: from mulinux.home (unknown [10.226.92.17]) by relmlir5.idc.renesas.com (Postfix) with ESMTP id 5F0A74017975; Thu, 6 Mar 2025 01:38:07 +0900 (JST) From: Fabrizio Castro To: Linus Walleij , Geert Uytterhoeven Cc: Fabrizio Castro , Lad Prabhakar , linux-renesas-soc@vger.kernel.org, linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, Biju Das Subject: [PATCH 3/4] pinctrl: renesas: rzv2m: Fix missing of_node_put() call Date: Wed, 5 Mar 2025 16:37:52 +0000 Message-Id: <20250305163753.34913-4-fabrizio.castro.jz@renesas.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250305163753.34913-1-fabrizio.castro.jz@renesas.com> References: <20250305163753.34913-1-fabrizio.castro.jz@renesas.com> Precedence: bulk X-Mailing-List: linux-renesas-soc@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 of_parse_phandle_with_fixed_args() requires its caller to call into of_node_put() on the node pointer from the output structure, but such a call is currently missing. Call into of_node_put() to rectify that. Fixes: 92a9b8252576 ("pinctrl: renesas: Add RZ/V2M pin and gpio controller driver") Signed-off-by: Fabrizio Castro Reviewed-by: Lad Prabhakar Reviewed-by: Geert Uytterhoeven --- drivers/pinctrl/renesas/pinctrl-rzv2m.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/pinctrl/renesas/pinctrl-rzv2m.c b/drivers/pinctrl/renesas/pinctrl-rzv2m.c index 4062c56619f5..8c7169db4fcc 100644 --- a/drivers/pinctrl/renesas/pinctrl-rzv2m.c +++ b/drivers/pinctrl/renesas/pinctrl-rzv2m.c @@ -940,6 +940,8 @@ static int rzv2m_gpio_register(struct rzv2m_pinctrl *pctrl) return ret; } + of_node_put(of_args.np); + if (of_args.args[0] != 0 || of_args.args[1] != 0 || of_args.args[2] != pctrl->data->n_port_pins) { dev_err(pctrl->dev, "gpio-ranges does not match selected SOC\n"); From patchwork Wed Mar 5 16:37:53 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabrizio Castro X-Patchwork-Id: 14002979 X-Patchwork-Delegate: geert@linux-m68k.org Received: from relmlie5.idc.renesas.com (relmlor1.renesas.com [210.160.252.171]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D9C1E18DF8D; Wed, 5 Mar 2025 16:38:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=210.160.252.171 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741192696; cv=none; b=qys9EXqADTtkuvmpCmNDCd9j7ea3trKj+BiOnjWSEuuQwI74y1VyTHnUjPlOvzNtuWl2mLLmkQhNRBopDRW3kHAh2AlwVga+CmuSdZ4VbzbVsYDPc3avabEC+jRDLEmvDlZ8LzXKHaElorBAQkrYB0izvMez6BbwTr6DVDnRdAk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741192696; c=relaxed/simple; bh=pOsUmy8q7SFXtRB+nB95ztJwXFd1eWeqK2uicbiqJHw=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=QLeqMhDDVLP3ZZK2nyLO0ve60GTLvRXmKNgqXLaYmUME1AJnZtV9+to5Q1cvmC76MlYPiDh86gAg5BbJ7WvL76UCFkFi4Squ/uNUagNiN45F51JamwNTjA0qq+GrfcI8bCK5IBtyVOfBmSLTP3oaYVLymgkV12b3pm14Qo7N3LU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=renesas.com; spf=pass smtp.mailfrom=renesas.com; arc=none smtp.client-ip=210.160.252.171 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=renesas.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=renesas.com X-CSE-ConnectionGUID: MlfZZ+71TH6yMtp9vx2vsg== X-CSE-MsgGUID: wdZostsNQs+xEhUPxTTBjw== Received: from unknown (HELO relmlir5.idc.renesas.com) ([10.200.68.151]) by relmlie5.idc.renesas.com with ESMTP; 06 Mar 2025 01:38:13 +0900 Received: from mulinux.home (unknown [10.226.92.17]) by relmlir5.idc.renesas.com (Postfix) with ESMTP id 507464017975; Thu, 6 Mar 2025 01:38:10 +0900 (JST) From: Fabrizio Castro To: Linus Walleij , Geert Uytterhoeven Cc: Fabrizio Castro , Chris Brandt , Jacopo Mondi , linux-renesas-soc@vger.kernel.org, linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, Biju Das , Lad Prabhakar Subject: [PATCH 4/4] pinctrl: renesas: rza2: Fix missing of_node_put() call Date: Wed, 5 Mar 2025 16:37:53 +0000 Message-Id: <20250305163753.34913-5-fabrizio.castro.jz@renesas.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250305163753.34913-1-fabrizio.castro.jz@renesas.com> References: <20250305163753.34913-1-fabrizio.castro.jz@renesas.com> Precedence: bulk X-Mailing-List: linux-renesas-soc@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 of_parse_phandle_with_fixed_args() requires its caller to call into of_node_put() on the node pointer from the output structure, but such a call is currently missing. Call into of_node_put() to rectify that. Fixes: b59d0e782706 ("pinctrl: Add RZ/A2 pin and gpio controller") Signed-off-by: Fabrizio Castro Reviewed-by: Lad Prabhakar Reviewed-by: Geert Uytterhoeven --- drivers/pinctrl/renesas/pinctrl-rza2.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/pinctrl/renesas/pinctrl-rza2.c b/drivers/pinctrl/renesas/pinctrl-rza2.c index a654ede01f70..3b5812963850 100644 --- a/drivers/pinctrl/renesas/pinctrl-rza2.c +++ b/drivers/pinctrl/renesas/pinctrl-rza2.c @@ -259,6 +259,8 @@ static int rza2_gpio_register(struct rza2_pinctrl_priv *priv) return ret; } + of_node_put(of_args.np); + if ((of_args.args[0] != 0) || (of_args.args[1] != 0) || (of_args.args[2] != priv->npins)) {