Skip to contentSkip to conversation

pxa2xx-ac97: Use platform device IRQ resource.

PATCH Eric Miao 1 participant 1 message Dec 14, 2010 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

Eric Miao

author Acked-by
#1 lore raw
Quoted 5 lines · Lennert Buytenhek

Instead of using the IRQ_AC97 define, which forces a dependency on platform include files, take the IRQ number to use from the specified platform device's first IRQ resource.

Quoted 42 lines
sound/arm/pxa2xx-ac97-lib.c +8 -1
index 88eec38..3921f4a 100644
@@ -20,7 +20,6 @@
  #include <sound/ac97_codec.h>
  #include <sound/pxa2xx-lib.h>
 
-#include <asm/irq.h>
  #include <mach/regs-ac97.h>
  #include <mach/audio.h>
 
@@ -314,9 +313,17 @@ EXPORT_SYMBOL_GPL(pxa2xx_ac97_hw_resume);
 
  int __devinit pxa2xx_ac97_hw_probe(struct platform_device *dev)
  {
+       int irq;
        int ret;
        pxa2xx_audio_ops_t *pdata = dev->dev.platform_data;
 
+       irq = platform_get_irq(dev, 0);
+       if (irq < 0) {
+               dev_err(&dev->dev, "no IRQ resource defined\n");
+               ret = -EINVAL;
+               goto err_conf;
+       }
+
        if (pdata) {
                switch (pdata->reset_gpio) {

               case 95:

sound/arm/pxa2xx-ac97-lib.c +1 -1
@@ -359,7 +366,7 @@ int __devinit pxa2xx_ac97_hw_probe(struct platform_device *dev)
        if (ret)
                goto err_clk2;
 
-       ret = request_irq(IRQ_AC97, pxa2xx_ac97_irq, IRQF_DISABLED, "AC97", NULL);
+       ret = request_irq(irq, pxa2xx_ac97_irq, IRQF_DISABLED, "AC97", NULL);
        if (ret < 0)
                goto err_irq;
 

sound/arm/pxa2xx-ac97-lib.c EXPORT_SYMBOL_GPL(pxa2xx_ac97_hw_probe); · line 396

Quoted 8 lines
sound/arm/pxa2xx-ac97-lib.c +1 -1
@@ -383,7 +390,7 @@ EXPORT_SYMBOL_GPL(pxa2xx_ac97_hw_probe);
  void pxa2xx_ac97_hw_remove(struct platform_device *dev)
  {
        GCR |= GCR_ACLINK_OFF;
-       free_irq(IRQ_AC97, NULL);
+       free_irq(platform_get_irq(dev, 0), NULL);
        if (ac97conf_clk) {
                clk_put(ac97conf_clk);
                ac97conf_clk = NULL;

_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel