Skip to content

Commit

Permalink
irqchip/renesas-rzg2l: Use devm_pm_runtime_enable()
Browse files Browse the repository at this point in the history
Simplify rzg2l_irqc_common_init() by using devm_pm_runtime_enable().

Signed-off-by: Fabrizio Castro <fabrizio.castro.jz@renesas.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lore.kernel.org/all/20250212182034.366167-4-fabrizio.castro.jz@renesas.com
  • Loading branch information
Fabrizio Castro authored and Thomas Gleixner committed Feb 18, 2025
1 parent 78f384d commit 7de1136
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions drivers/irqchip/irq-renesas-rzg2l.c
Original file line number Diff line number Diff line change
Expand Up @@ -568,11 +568,16 @@ static int rzg2l_irqc_common_init(struct device_node *node, struct device_node *
return PTR_ERR(resetn);
}

pm_runtime_enable(dev);
ret = devm_pm_runtime_enable(dev);
if (ret < 0) {
dev_err(dev, "devm_pm_runtime_enable failed: %d\n", ret);
return ret;
}

ret = pm_runtime_resume_and_get(dev);
if (ret < 0) {
dev_err(dev, "pm_runtime_resume_and_get failed: %d\n", ret);
goto pm_disable;
return ret;
}

raw_spin_lock_init(&rzg2l_irqc_data->lock);
Expand Down Expand Up @@ -603,8 +608,7 @@ static int rzg2l_irqc_common_init(struct device_node *node, struct device_node *

pm_put:
pm_runtime_put(dev);
pm_disable:
pm_runtime_disable(dev);

return ret;
}

Expand Down

0 comments on commit 7de1136

Please sign in to comment.