irqchip: skip suspend/resume if base address is null

The gic suspend and resume are registered by initcall.
Skip them if no such gic exists.

Change-Id: I630095c8e7ca6f16003a38d61b4dc359362aa3e3
Signed-off-by: Yimin Peng <yiminp@codeaurora.org>
tirimbino
Yimin Peng 5 years ago
parent 8ff9672bac
commit d22d4f93c6
  1. 6
      drivers/irqchip/irq-gic-v3.c
  2. 6
      drivers/irqchip/irq-gic.c

@ -409,6 +409,9 @@ static void gic_hibernation_suspend(void)
void __iomem *base = gic_data.dist_base;
void __iomem *rdist_base = gic_data_rdist_sgi_base();
if ((base == NULL) || (rdist_base == NULL))
return;
gic_data.enabled_sgis = readl_relaxed(rdist_base + GICD_ISENABLER);
gic_data.pending_sgis = readl_relaxed(rdist_base + GICD_ISPENDR);
/* Store edge level for PPIs by reading GICR_ICFGR1 */
@ -442,6 +445,9 @@ static void gic_show_resume_irq(struct gic_chip_data *gic)
u32 pending[32];
void __iomem *base = gic_data.dist_base;
if (base == NULL)
return;
if (!msm_show_resume_irq_mask)
return;

@ -249,6 +249,9 @@ static int gic_suspend_one(struct gic_chip_data *gic)
unsigned int i;
void __iomem *base = gic_data_dist_base(gic);
if (base == NULL)
return 0;
for (i = 0; i * 32 < gic->gic_irqs; i++) {
gic->enabled_irqs[i]
= readl_relaxed(base + GIC_DIST_ENABLE_SET + i * 4);
@ -280,6 +283,9 @@ static void gic_show_resume_irq(struct gic_chip_data *gic)
u32 pending[32];
void __iomem *base = gic_data_dist_base(gic);
if (base == NULL)
return;
raw_spin_lock(&irq_controller_lock);
for (i = 0; i * 32 < gic->gic_irqs; i++) {
enabled = readl_relaxed(base + GIC_DIST_ENABLE_CLEAR + i * 4);

Loading…
Cancel
Save