* [PATCH] port pcxhr driver do devres
@ 2008-09-21 15:31 Rolf Eike Beer
2008-09-23 11:35 ` Takashi Iwai
0 siblings, 1 reply; 3+ messages in thread
From: Rolf Eike Beer @ 2008-09-21 15:31 UTC (permalink / raw)
To: perex; +Cc: alsa-devel
[-- Attachment #1.1: Type: text/plain, Size: 2661 bytes --]
Signed-off-by: Rolf Eike Beer <eike-kernel@sf-tec.de>
---
I was a bit bored and ported the pcxhr driver to use devres to manage it's
IRQ and PCI resources. This is completely untested as I don't have such a
card but you might find it useful nevertheless.
commit e7df0303a1517bdd0d2f0af5fbdf91acc0b7f426
tree 45fbf9c75c8ea51ae89f0409ed02138380b71624
parent 9824b8f11373b0df806c135a342da9319ef1d893
author Rolf Eike Beer <eike-kernel@sf-tec.de> Sun, 21 Sep 2008 17:26:28 +0200
committer Rolf Eike Beer <eike-kernel@sf-tec.de> Sun, 21 Sep 2008 17:26:28 +0200
sound/pci/pcxhr/pcxhr.c | 14 ++------------
1 files changed, 2 insertions(+), 12 deletions(-)
diff --git a/sound/pci/pcxhr/pcxhr.c b/sound/pci/pcxhr/pcxhr.c
index 2c7e253..676389e 100644
--- a/sound/pci/pcxhr/pcxhr.c
+++ b/sound/pci/pcxhr/pcxhr.c
@@ -1171,12 +1171,6 @@ static int pcxhr_free(struct pcxhr_mgr *mgr)
snd_printdd("reset pcxhr !\n");
}
- /* release irq */
- if (mgr->irq >= 0)
- free_irq(mgr->irq, mgr);
-
- pci_release_regions(mgr->pci);
-
/* free hostport purgebuffer */
if (mgr->hostport.area) {
snd_dma_free_pages(&mgr->hostport);
@@ -1185,7 +1179,6 @@ static int pcxhr_free(struct pcxhr_mgr *mgr)
kfree(mgr->prmh);
- pci_disable_device(mgr->pci);
kfree(mgr);
return 0;
}
@@ -1210,21 +1203,19 @@ static int __devinit pcxhr_probe(struct pci_dev *pci, const struct pci_device_id
}
/* enable PCI device */
- if ((err = pci_enable_device(pci)) < 0)
+ if ((err = pcim_enable_device(pci)) < 0)
return err;
pci_set_master(pci);
/* check if we can restrict PCI DMA transfers to 32 bits */
if (pci_set_dma_mask(pci, DMA_32BIT_MASK) < 0) {
snd_printk(KERN_ERR "architecture does not support 32bit PCI busmaster DMA\n");
- pci_disable_device(pci);
return -ENXIO;
}
/* alloc card manager */
mgr = kzalloc(sizeof(*mgr), GFP_KERNEL);
if (! mgr) {
- pci_disable_device(pci);
return -ENOMEM;
}
@@ -1238,7 +1229,6 @@ static int __devinit pcxhr_probe(struct pci_dev *pci, const struct pci_device_id
/* resource assignment */
if ((err = pci_request_regions(pci, card_name)) < 0) {
kfree(mgr);
- pci_disable_device(pci);
return err;
}
for (i = 0; i < 3; i++)
@@ -1247,7 +1237,7 @@ static int __devinit pcxhr_probe(struct pci_dev *pci, const struct pci_device_id
mgr->pci = pci;
mgr->irq = -1;
- if (request_irq(pci->irq, pcxhr_interrupt, IRQF_SHARED,
+ if (devm_request_irq(&pci->dev, pci->irq, pcxhr_interrupt, IRQF_SHARED,
card_name, mgr)) {
snd_printk(KERN_ERR "unable to grab IRQ %d\n", pci->irq);
pcxhr_free(mgr);
[-- Attachment #1.2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 197 bytes --]
[-- Attachment #2: Type: text/plain, Size: 160 bytes --]
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] port pcxhr driver do devres
2008-09-21 15:31 [PATCH] port pcxhr driver do devres Rolf Eike Beer
@ 2008-09-23 11:35 ` Takashi Iwai
2008-10-15 21:33 ` Rolf Eike Beer
0 siblings, 1 reply; 3+ messages in thread
From: Takashi Iwai @ 2008-09-23 11:35 UTC (permalink / raw)
To: Rolf Eike Beer; +Cc: alsa-devel
At Sun, 21 Sep 2008 17:31:39 +0200,
Rolf Eike Beer wrote:
>
> Signed-off-by: Rolf Eike Beer <eike-kernel@sf-tec.de>
>
> ---
> I was a bit bored and ported the pcxhr driver to use devres to manage it's
> IRQ and PCI resources. This is completely untested as I don't have such a
> card but you might find it useful nevertheless.
Thanks for the patch.
I think it's good to do this kind of clean ups, but I'd like to make
sure that it works properly after the change.
Any other sound driver to test by yourself?
Takashi
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] port pcxhr driver do devres
2008-09-23 11:35 ` Takashi Iwai
@ 2008-10-15 21:33 ` Rolf Eike Beer
0 siblings, 0 replies; 3+ messages in thread
From: Rolf Eike Beer @ 2008-10-15 21:33 UTC (permalink / raw)
To: Takashi Iwai; +Cc: alsa-devel
[-- Attachment #1.1: Type: text/plain, Size: 652 bytes --]
Takashi Iwai wrote:
> At Sun, 21 Sep 2008 17:31:39 +0200,
>
> Rolf Eike Beer wrote:
> > Signed-off-by: Rolf Eike Beer <eike-kernel@sf-tec.de>
> >
> > ---
> > I was a bit bored and ported the pcxhr driver to use devres to manage
> > it's IRQ and PCI resources. This is completely untested as I don't have
> > such a card but you might find it useful nevertheless.
>
> Thanks for the patch.
>
> I think it's good to do this kind of clean ups, but I'd like to make
> sure that it works properly after the change.
>
> Any other sound driver to test by yourself?
Sorry for the delay. No, nothing around at the moment, especially no time.
Greetings,
Eike
[-- Attachment #1.2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 197 bytes --]
[-- Attachment #2: Type: text/plain, Size: 160 bytes --]
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2008-10-15 21:36 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-09-21 15:31 [PATCH] port pcxhr driver do devres Rolf Eike Beer
2008-09-23 11:35 ` Takashi Iwai
2008-10-15 21:33 ` Rolf Eike Beer
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.