[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230214233426.2994501-3-f.fainelli@gmail.com>
Date: Tue, 14 Feb 2023 15:34:25 -0800
From: Florian Fainelli <f.fainelli@...il.com>
To: linux-arm-kernel@...ts.infradead.org
Cc: Florian Fainelli <f.fainelli@...il.com>,
Thomas Gleixner <tglx@...utronix.de>,
Marc Zyngier <maz@...nel.org>,
Oliver Upton <oliver.upton@...ux.dev>,
linux-kernel@...r.kernel.org (open list:IRQCHIP DRIVERS),
Sudeep Holla <sudeep.holla@....com>,
Broadcom internal kernel review list
<bcm-kernel-feedback-list@...adcom.com>
Subject: [PATCH 2/3] irqchip/gic-v3: Propagate gic_cpu_pm_init() return code
In preparation for allocating memory which may fail, propagate the
return code from gic_cpu_pm_init().
Signed-off-by: Florian Fainelli <f.fainelli@...il.com>
---
drivers/irqchip/irq-gic-v3.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/drivers/irqchip/irq-gic-v3.c b/drivers/irqchip/irq-gic-v3.c
index b60fadb7eb44..48b0e9aba27c 100644
--- a/drivers/irqchip/irq-gic-v3.c
+++ b/drivers/irqchip/irq-gic-v3.c
@@ -1395,9 +1395,11 @@ static struct notifier_block gic_cpu_pm_notifier_block = {
.notifier_call = gic_cpu_pm_notifier,
};
-static void gic_cpu_pm_init(void)
+static int gic_cpu_pm_init(void)
{
cpu_pm_register_notifier(&gic_cpu_pm_notifier_block);
+
+ return 0;
}
#else
@@ -1891,7 +1893,9 @@ static int __init gic_init_bases(void __iomem *dist_base,
gic_dist_init();
gic_cpu_init();
gic_smp_init();
- gic_cpu_pm_init();
+ err = gic_cpu_pm_init();
+ if (err)
+ goto out_set_handle;
if (gic_dist_supports_lpis()) {
its_init(handle, &gic_data.rdists, gic_data.domain);
@@ -1906,6 +1910,8 @@ static int __init gic_init_bases(void __iomem *dist_base,
return 0;
+out_set_handle:
+ set_handle_irq(NULL);
out_free:
if (gic_data.domain)
irq_domain_remove(gic_data.domain);
--
2.34.1
Powered by blists - more mailing lists