Skip to contentSkip to conversation

genirq: using pm_runtime_resume_and_get instead of pm_runtime_get_sync

PATCH Applied [email protected] 2 participants 2 messages Apr 18, 2022 – May 2, 2022 IRQ

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 genirq: using pm_runtime_resume_and_get instead of pm_runtime_get_sync

From: Minghao Chi <[email protected]>

Using pm_runtime_resume_and_get is more appropriate for simplifing code

---
 kernel/irq/chip.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
kernel/irq/chip.c +2 -4
index 54af0deb239b..8ddcb8e883d7 100644
@@ -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;
Signature · 1 line
2.25.1
merge bot Applied
#1 lore raw

[tip: irq/core] genirq: Use pm_runtime_resume_and_get() instead of pm_runtime_get_sync()

The following commit has been merged into the irq/core branch of tip:

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 <[email protected]>
AuthorDate:    Mon, 18 Apr 2022 11:07:16 
Committer:     Thomas Gleixner <[email protected]>
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 ]

---
 kernel/irq/chip.c | 13 ++++---------
 1 file changed, 4 insertions(+), 9 deletions(-)
kernel/irq/chip.c +4 -9
index 54af0de..e6b8e56 100644
@@ -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;
 }
 
 /**