diff options
author | Minghao Chi <chi.minghao@zte.com.cn> | 2022-04-18 14:07:16 +0300 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2022-05-02 15:08:08 +0300 |
commit | ce4818957fdc5bca57fc2c92b0dfe109d26bcc47 (patch) | |
tree | a870d96ab9f01f56de8f1a8835cf0b040b5e3e6f /kernel/irq | |
parent | 1adb4d7ad3a585b451f5cf6b0a90c5917af3eac5 (diff) | |
download | linux-ce4818957fdc5bca57fc2c92b0dfe109d26bcc47.tar.xz |
genirq: Use pm_runtime_resume_and_get() instead of pm_runtime_get_sync()
pm_runtime_resume_and_get() achieves the same and simplifies the code.
[ tglx: Simplify it further by presetting retval ]
Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: Minghao Chi <chi.minghao@zte.com.cn>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lore.kernel.org/r/20220418110716.2559453-1-chi.minghao@zte.com.cn
Diffstat (limited to 'kernel/irq')
-rw-r--r-- | kernel/irq/chip.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/kernel/irq/chip.c b/kernel/irq/chip.c index 54af0deb239b..e6b8e564b37f 100644 --- a/kernel/irq/chip.c +++ b/kernel/irq/chip.c @@ -1573,17 +1573,12 @@ static struct device *irq_get_parent_device(struct irq_data *data) int irq_chip_pm_get(struct irq_data *data) { struct device *dev = irq_get_parent_device(data); - int retval; + int retval = 0; - if (IS_ENABLED(CONFIG_PM) && dev) { - retval = pm_runtime_get_sync(dev); - if (retval < 0) { - pm_runtime_put_noidle(dev); - return retval; - } - } + if (IS_ENABLED(CONFIG_PM) && dev) + retval = pm_runtime_resume_and_get(dev); - return 0; + return retval; } /** |