Skip to contentSkip to conversation

intel_pmic_gpio: modify EOI handling following change of kernel irq subsystem

PATCH Applied Feng Tang 2 participants 4 messages Dec 30, 2010 – Jan 7, 2011 x86 platform drivers

lore
Share & tools
lore

Feng Tang

author
#0 lore raw

PATCH 1/1 intel_pmic_gpio: modify EOI handling following change of kernel irq subsystem

Latest kernel has many changes in IRQ subsystem and its interfaces, like adding "irq_eoi" for struct irq_chip, this patch will make it support both the new and old interface.

---
 drivers/platform/x86/intel_pmic_gpio.c |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)
drivers/platform/x86/intel_pmic_gpio.c +9 -1
index e61db9d..4efb2c6 100644
@@ -244,7 +244,15 @@ static void pmic_irq_handler(unsigned irq, struct irq_desc *desc)
 			generic_handle_irq(pg->irq_base + gpio);
 		}
 	}
-	desc->chip->eoi(irq);
+
+	if (desc->chip->irq_eoi)
+		desc->chip->irq_eoi(irq_get_irq_data(irq));
+#ifndef CONFIG_GENERIC_HARDIRQS_NO_DEPRECATED
+	else if (desc->chip->eoi)
+		desc->chip->eoi(irq);
+#endif
+	else
+		dev_warn(pg->chip.dev, "missing EOI handler for irq %d\n", irq);
 }
 
 static int __devinit platform_pmic_gpio_probe(struct platform_device *pdev)
Signature · 1 line
1.7.0.4
#1 lore raw
Quoted 3 lines · Feng Tang

Latest kernel has many changes in IRQ subsystem and its interfaces, like adding "irq_eoi" for struct irq_chip, this patch will make it support both the new and old interface.

There's no point in having compatibility stubs in the mainline kernel. Just fix the driver up to match the new behaviour.

Signature · 1 line
Matthew Garrett | [email protected]
author
#2 lore raw
Quoted 8 lines · On Thu, 30 Dec 2010 21:41:17 +0800 Matthew Garrett <[email protected]> wrote:
Quoted 3 lines · Feng Tang

Latest kernel has many changes in IRQ subsystem and its interfaces, like adding "irq_eoi" for struct irq_chip, this patch will make it support both the new and old interface.

There's no point in having compatibility stubs in the mainline kernel. Just fix the driver up to match the new behaviour.

Thanks for the comments, here is the revised one

-----
From 834453fe4cb94cfcda4487ef68967037f2b5d2f2 Mon Sep 17 00:00:00 2001
From: Feng Tang <[email protected]>
Date: Mon, 29 Nov 2010 13:39:40 +0800
Subject: [PATCH] intel_pmic_gpio: modify EOI handling following change of kernel irq subsystem

Latest kernel has many changes in IRQ subsystem and its interfaces, like adding "irq_eoi" for struct irq_chip, this patch will make it support both the new and old interface.

---
 drivers/platform/x86/intel_pmic_gpio.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
drivers/platform/x86/intel_pmic_gpio.c +5 -1
index e61db9d..930e627 100644
@@ -244,7 +244,11 @@ static void pmic_irq_handler(unsigned irq, struct irq_desc *desc)
 			generic_handle_irq(pg->irq_base + gpio);
 		}
 	}
-	desc->chip->eoi(irq);
+
+	if (desc->chip->irq_eoi)
+		desc->chip->irq_eoi(irq_get_irq_data(irq));
+	else
+		dev_warn(pg->chip.dev, "missing EOI handler for irq %d\n", irq);
 }
 
 static int __devinit platform_pmic_gpio_probe(struct platform_device *pdev)