Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 437a5a46 authored by Takashi Iwai's avatar Takashi Iwai Committed by Jaroslav Kysela
Browse files

[ALSA] Remove IRQF_DISABLED for shared PCI irqs



Fix IRQ flags for PCI devices.
The shared IRQs for PCI devices shouldn't be allocated with
IRQF_DISABLED.  Also, when MSI is enabled, IRQF_SHARED shouldn't
be used.
The patch removes unnecessary cast in request_irq and free_irq,
too.

Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
Signed-off-by: default avatarJaroslav Kysela <perex@suse.cz>
parent 01f681da
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -927,7 +927,7 @@
          <informalexample>
            <programlisting>
<![CDATA[
  struct mychip *chip = (struct mychip *)card->private_data;
  struct mychip *chip = card->private_data;
]]>
            </programlisting>
          </informalexample>
@@ -1095,7 +1095,7 @@

          /* release the irq */
          if (chip->irq >= 0)
                  free_irq(chip->irq, (void *)chip);
                  free_irq(chip->irq, chip);
          /* release the i/o ports & memory */
          pci_release_regions(chip->pci);
          /* disable the PCI entry */
@@ -1148,7 +1148,7 @@
          }
          chip->port = pci_resource_start(pci, 0);
          if (request_irq(pci->irq, snd_mychip_interrupt,
                          IRQF_DISABLED|IRQF_SHARED, "My Chip", chip)) {
                          IRQF_SHARED, "My Chip", chip)) {
                  printk(KERN_ERR "cannot grab irq %d\n", pci->irq);
                  snd_mychip_free(chip);
                  return -EBUSY;
@@ -1387,7 +1387,7 @@
          <programlisting>
<![CDATA[
  if (chip->irq >= 0)
          free_irq(chip->irq, (void *)chip);
          free_irq(chip->irq, chip);
]]>
          </programlisting>
        </informalexample>
+1 −1
Original line number Diff line number Diff line
@@ -232,7 +232,7 @@ int snd_sbdsp_create(struct snd_card *card,
	chip->port = port;
	
	if (request_irq(irq, irq_handler, hardware == SB_HW_ALS4000 ?
			IRQF_DISABLED | IRQF_SHARED : IRQF_DISABLED,
			IRQF_SHARED : IRQF_DISABLED,
			"SoundBlaster", (void *) chip)) {
		snd_printk(KERN_ERR "sb: can't grab irq %d\n", irq);
		snd_sbdsp_free(chip);
+2 −2
Original line number Diff line number Diff line
@@ -858,7 +858,7 @@ snd_ad1889_free(struct snd_ad1889 *chip)
	synchronize_irq(chip->irq);
	
	if (chip->irq >= 0)
		free_irq(chip->irq, (void*)chip);
		free_irq(chip->irq, chip);

skip_hw:
	if (chip->iobase)
@@ -945,7 +945,7 @@ snd_ad1889_create(struct snd_card *card,
	spin_lock_init(&chip->lock);	/* only now can we call ad1889_free */

	if (request_irq(pci->irq, snd_ad1889_interrupt,
			IRQF_DISABLED|IRQF_SHARED, card->driver, (void*)chip)) {
			IRQF_SHARED, card->driver, chip)) {
		printk(KERN_ERR PFX "cannot obtain IRQ %d\n", pci->irq);
		snd_ad1889_free(chip);
		return -EBUSY;
+3 −2
Original line number Diff line number Diff line
@@ -2095,7 +2095,7 @@ static int snd_ali_free(struct snd_ali * codec)
		snd_ali_disable_address_interrupt(codec);
	if (codec->irq >= 0) {
		synchronize_irq(codec->irq);
		free_irq(codec->irq, (void *)codec);
		free_irq(codec->irq, codec);
	}
	if (codec->port)
		pci_release_regions(codec->pci);
@@ -2192,7 +2192,8 @@ static int __devinit snd_ali_resources(struct snd_ali *codec)
		return err;
	codec->port = pci_resource_start(codec->pci, 0);

	if (request_irq(codec->pci->irq, snd_ali_card_interrupt, IRQF_DISABLED|IRQF_SHARED, "ALI 5451", (void *)codec)) {
	if (request_irq(codec->pci->irq, snd_ali_card_interrupt,
			IRQF_SHARED, "ALI 5451", codec)) {
		snd_printk(KERN_ERR "Unable to request irq.\n");
		return -EBUSY;
	}
+3 −3
Original line number Diff line number Diff line
@@ -190,7 +190,7 @@ static int snd_als300_free(struct snd_als300 *chip)
	snd_als300_dbgcallenter();
	snd_als300_set_irq_flag(chip, IRQ_DISABLE);
	if (chip->irq >= 0)
		free_irq(chip->irq, (void *)chip);
		free_irq(chip->irq, chip);
	pci_release_regions(chip->pci);
	pci_disable_device(chip->pci);
	kfree(chip);
@@ -722,8 +722,8 @@ static int __devinit snd_als300_create(snd_card_t *card,
	else
		irq_handler = snd_als300_interrupt;

	if (request_irq(pci->irq, irq_handler, IRQF_DISABLED|IRQF_SHARED,
					card->shortname, (void *)chip)) {
	if (request_irq(pci->irq, irq_handler, IRQF_SHARED,
			card->shortname, chip)) {
		snd_printk(KERN_ERR "unable to grab IRQ %d\n", pci->irq);
		snd_als300_free(chip);
		return -EBUSY;
Loading