Re: [alsa-devel] [PATCH] pxa2xx-ac97: Use platform device IRQ resource.
On Wed, Dec 15, 2010 at 1:19 AM, Lennert Buytenhek buytenh@wantstofly.org wrote:
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.
Signed-off-by: Lennert Buytenhek buytenh@secretlab.ca
Acked-by: Eric Miao eric.y.miao@gmail.com
diff --git a/sound/arm/pxa2xx-ac97-lib.c b/sound/arm/pxa2xx-ac97-lib.c index 88eec38..3921f4a 100644 --- a/sound/arm/pxa2xx-ac97-lib.c +++ b/sound/arm/pxa2xx-ac97-lib.c @@ -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: @@ -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;
@@ -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;
participants (1)
-
Eric Miao