From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4C1E5215060; Tue, 29 Apr 2025 16:56:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1745945797; cv=none; b=Q/xeQ9GYiXqNMUrHMlyrE9W4gxz7i3vXog9G5FGFAClp2cJd/bNjrHnaqtcNEBZ/Kxu0FieTGO8f/hPEjEGiv8XLK5Q18FN5M/l6/65qU3su7/EMMYanznUEe0uwaNvUKLfQHvegmVFCVopju+QMnjHnKgmNMfvGT1/nyOBcAdM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1745945797; c=relaxed/simple; bh=bD59qvbaCFO7KEZNHneRj4N2VSNGeTuglSuhao1qv9A=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=iJgxra7zDnV4seU44Q/GMuy6Z6A+CTw2cnI8QmI17aq9pBa7vhrrYbuvvInRn1F23kCn1NUBo8qLLpcs9FGgwh/yGLcpLc+2kYa5K7s68vVPPh0TU8Hw9tgwH4ZyF9gkIBXogJaIqBqcWqk2FM5lVMPS8jYc+SVjpBAI5BeiiFk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=oAcGk/Xy; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="oAcGk/Xy" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 59D71C4CEE3; Tue, 29 Apr 2025 16:56:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1745945796; bh=bD59qvbaCFO7KEZNHneRj4N2VSNGeTuglSuhao1qv9A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=oAcGk/Xypekb8hu81dc4IaICMWOgO5Vaid8on55y5cTmZWE+tHZaoRWcofhVxI1dW /DRL0hx9lvdHCJRH8nS+NKeMjxtzwCy1s2nE/FQ6gqSM4JIpkGgcfhWgXTiPfU+6TA ekhmRbyBNpzj9bpRZXDG3fpJK+YfI9CzM2Rju68w= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Biju Das , Thomas Gleixner , Geert Uytterhoeven , Philipp Zabel , Sasha Levin Subject: [PATCH 6.14 023/311] irqchip/renesas-rzv2h: Simplify rzv2h_icu_init() Date: Tue, 29 Apr 2025 18:37:40 +0200 Message-ID: <20250429161121.979513648@linuxfoundation.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250429161121.011111832@linuxfoundation.org> References: <20250429161121.011111832@linuxfoundation.org> User-Agent: quilt/0.68 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Biju Das [ Upstream commit f5de95438834a3bc3ad747f67c9da93cd08e5008 ] Use devm_add_action_or_reset() for calling put_device in error path of rzv2h_icu_init() to simplify the code by using the recently added devm_* helpers. Signed-off-by: Biju Das Signed-off-by: Thomas Gleixner Reviewed-by: Geert Uytterhoeven Reviewed-by: Philipp Zabel Link: https://lore.kernel.org/all/20250224131253.134199-5-biju.das.jz@bp.renesas.com Stable-dep-of: 28e89cdac648 ("irqchip/renesas-rzv2h: Prevent TINT spurious interrupt") Signed-off-by: Sasha Levin --- drivers/irqchip/irq-renesas-rzv2h.c | 37 +++++++++++++++-------------- 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/drivers/irqchip/irq-renesas-rzv2h.c b/drivers/irqchip/irq-renesas-rzv2h.c index f6363246a71a0..6be38aa86f9b8 100644 --- a/drivers/irqchip/irq-renesas-rzv2h.c +++ b/drivers/irqchip/irq-renesas-rzv2h.c @@ -421,6 +421,11 @@ static int rzv2h_icu_parse_interrupts(struct rzv2h_icu_priv *priv, struct device return 0; } +static void rzv2h_icu_put_device(void *data) +{ + put_device(data); +} + static int rzv2h_icu_init(struct device_node *node, struct device_node *parent) { struct irq_domain *irq_domain, *parent_domain; @@ -433,43 +438,41 @@ static int rzv2h_icu_init(struct device_node *node, struct device_node *parent) if (!pdev) return -ENODEV; + ret = devm_add_action_or_reset(&pdev->dev, rzv2h_icu_put_device, + &pdev->dev); + if (ret < 0) + return ret; + parent_domain = irq_find_host(parent); if (!parent_domain) { dev_err(&pdev->dev, "cannot find parent domain\n"); - ret = -ENODEV; - goto put_dev; + return -ENODEV; } rzv2h_icu_data = devm_kzalloc(&pdev->dev, sizeof(*rzv2h_icu_data), GFP_KERNEL); - if (!rzv2h_icu_data) { - ret = -ENOMEM; - goto put_dev; - } + if (!rzv2h_icu_data) + return -ENOMEM; rzv2h_icu_data->irqchip = &rzv2h_icu_chip; rzv2h_icu_data->base = devm_of_iomap(&pdev->dev, pdev->dev.of_node, 0, NULL); - if (IS_ERR(rzv2h_icu_data->base)) { - ret = PTR_ERR(rzv2h_icu_data->base); - goto put_dev; - } + if (IS_ERR(rzv2h_icu_data->base)) + return PTR_ERR(rzv2h_icu_data->base); ret = rzv2h_icu_parse_interrupts(rzv2h_icu_data, node); if (ret) { dev_err(&pdev->dev, "cannot parse interrupts: %d\n", ret); - goto put_dev; + return ret; } resetn = devm_reset_control_get_exclusive(&pdev->dev, NULL); - if (IS_ERR(resetn)) { - ret = PTR_ERR(resetn); - goto put_dev; - } + if (IS_ERR(resetn)) + return PTR_ERR(resetn); ret = reset_control_deassert(resetn); if (ret) { dev_err(&pdev->dev, "failed to deassert resetn pin, %d\n", ret); - goto put_dev; + return ret; } pm_runtime_enable(&pdev->dev); @@ -500,8 +503,6 @@ static int rzv2h_icu_init(struct device_node *node, struct device_node *parent) pm_disable: pm_runtime_disable(&pdev->dev); reset_control_assert(resetn); -put_dev: - put_device(&pdev->dev); return ret; } -- 2.39.5