* [PATCH] genirq: using pm_runtime_resume_and_get instead of pm_runtime_get_sync
@ 2022-04-18 11:07 cgel.zte
2022-05-02 12:11 ` [tip: irq/core] genirq: Use pm_runtime_resume_and_get() instead of pm_runtime_get_sync() tip-bot2 for Minghao Chi
0 siblings, 1 reply; 2+ messages in thread
From: cgel.zte @ 2022-04-18 11:07 UTC (permalink / raw)
To: tglx; +Cc: linux-kernel, Minghao Chi, Zeal Robot
From: Minghao Chi <chi.minghao@zte.com.cn>
Using pm_runtime_resume_and_get is more appropriate
for simplifing code
Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: Minghao Chi <chi.minghao@zte.com.cn>
---
kernel/irq/chip.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/kernel/irq/chip.c b/kernel/irq/chip.c
index 54af0deb239b..8ddcb8e883d7 100644
--- a/kernel/irq/chip.c
+++ b/kernel/irq/chip.c
@@ -1576,11 +1576,9 @@ int irq_chip_pm_get(struct irq_data *data)
int retval;
if (IS_ENABLED(CONFIG_PM) && dev) {
- retval = pm_runtime_get_sync(dev);
- if (retval < 0) {
- pm_runtime_put_noidle(dev);
+ retval = pm_runtime_resume_and_get(dev);
+ if (retval < 0)
return retval;
- }
}
return 0;
--
2.25.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [tip: irq/core] genirq: Use pm_runtime_resume_and_get() instead of pm_runtime_get_sync()
2022-04-18 11:07 [PATCH] genirq: using pm_runtime_resume_and_get instead of pm_runtime_get_sync cgel.zte
@ 2022-05-02 12:11 ` tip-bot2 for Minghao Chi
0 siblings, 0 replies; 2+ messages in thread
From: tip-bot2 for Minghao Chi @ 2022-05-02 12:11 UTC (permalink / raw)
To: linux-tip-commits
Cc: Zeal Robot, Minghao Chi, Thomas Gleixner, x86, linux-kernel, maz
The following commit has been merged into the irq/core branch of tip:
Commit-ID: ce4818957fdc5bca57fc2c92b0dfe109d26bcc47
Gitweb: https://git.kernel.org/tip/ce4818957fdc5bca57fc2c92b0dfe109d26bcc47
Author: Minghao Chi <chi.minghao@zte.com.cn>
AuthorDate: Mon, 18 Apr 2022 11:07:16
Committer: Thomas Gleixner <tglx@linutronix.de>
CommitterDate: Mon, 02 May 2022 14:08:08 +02:00
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
---
kernel/irq/chip.c | 13 ++++---------
1 file changed, 4 insertions(+), 9 deletions(-)
diff --git a/kernel/irq/chip.c b/kernel/irq/chip.c
index 54af0de..e6b8e56 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;
}
/**
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-05-02 12:11 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-18 11:07 [PATCH] genirq: using pm_runtime_resume_and_get instead of pm_runtime_get_sync cgel.zte
2022-05-02 12:11 ` [tip: irq/core] genirq: Use pm_runtime_resume_and_get() instead of pm_runtime_get_sync() tip-bot2 for Minghao Chi
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).