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

Commit a54ba0fe authored by Takashi Iwai's avatar Takashi Iwai
Browse files

ALSA: hdsp: Use standard printk helpers



Convert with dev_err() and co from snd_printk(), etc.

Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent b59bb8ef
Loading
Loading
Loading
Loading
+79 −49
Original line number Original line Diff line number Diff line
@@ -675,14 +675,15 @@ static int hdsp_check_for_iobox (struct hdsp *hdsp)
		if (0 == (hdsp_read(hdsp, HDSP_statusRegister) &
		if (0 == (hdsp_read(hdsp, HDSP_statusRegister) &
					HDSP_ConfigError)) {
					HDSP_ConfigError)) {
			if (i) {
			if (i) {
				snd_printd("Hammerfall-DSP: IO box found after %d ms\n",
				dev_dbg(hdsp->card->dev,
					"IO box found after %d ms\n",
						(20 * i));
						(20 * i));
			}
			}
			return 0;
			return 0;
		}
		}
		msleep(20);
		msleep(20);
	}
	}
	snd_printk(KERN_ERR "Hammerfall-DSP: no IO box connected!\n");
	dev_err(hdsp->card->dev, "no IO box connected!\n");
	hdsp->state &= ~HDSP_FirmwareLoaded;
	hdsp->state &= ~HDSP_FirmwareLoaded;
	return -EIO;
	return -EIO;
}
}
@@ -699,13 +700,13 @@ static int hdsp_wait_for_iobox(struct hdsp *hdsp, unsigned int loops,
		if (hdsp_read(hdsp, HDSP_statusRegister) & HDSP_ConfigError)
		if (hdsp_read(hdsp, HDSP_statusRegister) & HDSP_ConfigError)
			msleep(delay);
			msleep(delay);
		else {
		else {
			snd_printd("Hammerfall-DSP: iobox found after %ums!\n",
			dev_dbg(hdsp->card->dev, "iobox found after %ums!\n",
				   i * delay);
				   i * delay);
			return 0;
			return 0;
		}
		}
	}
	}


	snd_printk("Hammerfall-DSP: no IO box connected!\n");
	dev_info(hdsp->card->dev, "no IO box connected!\n");
	hdsp->state &= ~HDSP_FirmwareLoaded;
	hdsp->state &= ~HDSP_FirmwareLoaded;
	return -EIO;
	return -EIO;
}
}
@@ -728,13 +729,14 @@ static int snd_hdsp_load_firmware_from_cache(struct hdsp *hdsp) {


	if ((hdsp_read (hdsp, HDSP_statusRegister) & HDSP_DllError) != 0) {
	if ((hdsp_read (hdsp, HDSP_statusRegister) & HDSP_DllError) != 0) {


		snd_printk ("Hammerfall-DSP: loading firmware\n");
		dev_info(hdsp->card->dev, "loading firmware\n");


		hdsp_write (hdsp, HDSP_control2Reg, HDSP_S_PROGRAM);
		hdsp_write (hdsp, HDSP_control2Reg, HDSP_S_PROGRAM);
		hdsp_write (hdsp, HDSP_fifoData, 0);
		hdsp_write (hdsp, HDSP_fifoData, 0);


		if (hdsp_fifo_wait (hdsp, 0, HDSP_LONG_WAIT)) {
		if (hdsp_fifo_wait (hdsp, 0, HDSP_LONG_WAIT)) {
			snd_printk ("Hammerfall-DSP: timeout waiting for download preparation\n");
			dev_info(hdsp->card->dev,
				 "timeout waiting for download preparation\n");
			hdsp_write(hdsp, HDSP_control2Reg, HDSP_S200);
			hdsp_write(hdsp, HDSP_control2Reg, HDSP_S200);
			return -EIO;
			return -EIO;
		}
		}
@@ -744,7 +746,8 @@ static int snd_hdsp_load_firmware_from_cache(struct hdsp *hdsp) {
		for (i = 0; i < HDSP_FIRMWARE_SIZE / 4; ++i) {
		for (i = 0; i < HDSP_FIRMWARE_SIZE / 4; ++i) {
			hdsp_write(hdsp, HDSP_fifoData, cache[i]);
			hdsp_write(hdsp, HDSP_fifoData, cache[i]);
			if (hdsp_fifo_wait (hdsp, 127, HDSP_LONG_WAIT)) {
			if (hdsp_fifo_wait (hdsp, 127, HDSP_LONG_WAIT)) {
				snd_printk ("Hammerfall-DSP: timeout during firmware loading\n");
				dev_info(hdsp->card->dev,
					 "timeout during firmware loading\n");
				hdsp_write(hdsp, HDSP_control2Reg, HDSP_S200);
				hdsp_write(hdsp, HDSP_control2Reg, HDSP_S200);
				return -EIO;
				return -EIO;
			}
			}
@@ -760,11 +763,12 @@ static int snd_hdsp_load_firmware_from_cache(struct hdsp *hdsp) {
		hdsp->control2_register = 0;
		hdsp->control2_register = 0;
#endif
#endif
		hdsp_write (hdsp, HDSP_control2Reg, hdsp->control2_register);
		hdsp_write (hdsp, HDSP_control2Reg, hdsp->control2_register);
		snd_printk ("Hammerfall-DSP: finished firmware loading\n");
		dev_info(hdsp->card->dev, "finished firmware loading\n");


	}
	}
	if (hdsp->state & HDSP_InitializationComplete) {
	if (hdsp->state & HDSP_InitializationComplete) {
		snd_printk(KERN_INFO "Hammerfall-DSP: firmware loaded from cache, restoring defaults\n");
		dev_info(hdsp->card->dev,
			 "firmware loaded from cache, restoring defaults\n");
		spin_lock_irqsave(&hdsp->lock, flags);
		spin_lock_irqsave(&hdsp->lock, flags);
		snd_hdsp_set_defaults(hdsp);
		snd_hdsp_set_defaults(hdsp);
		spin_unlock_irqrestore(&hdsp->lock, flags);
		spin_unlock_irqrestore(&hdsp->lock, flags);
@@ -791,7 +795,7 @@ static int hdsp_get_iobox_version (struct hdsp *hdsp)
		hdsp_write (hdsp, HDSP_fifoData, 0);
		hdsp_write (hdsp, HDSP_fifoData, 0);
		if (hdsp_fifo_wait(hdsp, 0, HDSP_SHORT_WAIT) < 0) {
		if (hdsp_fifo_wait(hdsp, 0, HDSP_SHORT_WAIT) < 0) {
			hdsp->io_type = Multiface;
			hdsp->io_type = Multiface;
			snd_printk("Hammerfall-DSP: Multiface found\n");
			dev_info(hdsp->card->dev, "Multiface found\n");
			return 0;
			return 0;
		}
		}


@@ -799,7 +803,7 @@ static int hdsp_get_iobox_version (struct hdsp *hdsp)
		hdsp_write(hdsp, HDSP_fifoData, 0);
		hdsp_write(hdsp, HDSP_fifoData, 0);
		if (hdsp_fifo_wait(hdsp, 0, HDSP_SHORT_WAIT) == 0) {
		if (hdsp_fifo_wait(hdsp, 0, HDSP_SHORT_WAIT) == 0) {
			hdsp->io_type = Digiface;
			hdsp->io_type = Digiface;
			snd_printk("Hammerfall-DSP: Digiface found\n");
			dev_info(hdsp->card->dev, "Digiface found\n");
			return 0;
			return 0;
		}
		}


@@ -808,7 +812,7 @@ static int hdsp_get_iobox_version (struct hdsp *hdsp)
		hdsp_write(hdsp, HDSP_fifoData, 0);
		hdsp_write(hdsp, HDSP_fifoData, 0);
		if (hdsp_fifo_wait(hdsp, 0, HDSP_SHORT_WAIT) == 0) {
		if (hdsp_fifo_wait(hdsp, 0, HDSP_SHORT_WAIT) == 0) {
			hdsp->io_type = Multiface;
			hdsp->io_type = Multiface;
			snd_printk("Hammerfall-DSP: Multiface found\n");
			dev_info(hdsp->card->dev, "Multiface found\n");
			return 0;
			return 0;
		}
		}


@@ -817,12 +821,12 @@ static int hdsp_get_iobox_version (struct hdsp *hdsp)
		hdsp_write(hdsp, HDSP_fifoData, 0);
		hdsp_write(hdsp, HDSP_fifoData, 0);
		if (hdsp_fifo_wait(hdsp, 0, HDSP_SHORT_WAIT) < 0) {
		if (hdsp_fifo_wait(hdsp, 0, HDSP_SHORT_WAIT) < 0) {
			hdsp->io_type = Multiface;
			hdsp->io_type = Multiface;
			snd_printk("Hammerfall-DSP: Multiface found\n");
			dev_info(hdsp->card->dev, "Multiface found\n");
			return 0;
			return 0;
		}
		}


		hdsp->io_type = RPM;
		hdsp->io_type = RPM;
		snd_printk("Hammerfall-DSP: RPM found\n");
		dev_info(hdsp->card->dev, "RPM found\n");
		return 0;
		return 0;
	} else {
	} else {
		/* firmware was already loaded, get iobox type */
		/* firmware was already loaded, get iobox type */
@@ -847,20 +851,18 @@ static int hdsp_check_for_firmware (struct hdsp *hdsp, int load_on_demand)
		hdsp->state &= ~HDSP_FirmwareLoaded;
		hdsp->state &= ~HDSP_FirmwareLoaded;
		if (! load_on_demand)
		if (! load_on_demand)
			return -EIO;
			return -EIO;
		snd_printk(KERN_ERR "Hammerfall-DSP: firmware not present.\n");
		dev_err(hdsp->card->dev, "firmware not present.\n");
		/* try to load firmware */
		/* try to load firmware */
		if (! (hdsp->state & HDSP_FirmwareCached)) {
		if (! (hdsp->state & HDSP_FirmwareCached)) {
			if (! hdsp_request_fw_loader(hdsp))
			if (! hdsp_request_fw_loader(hdsp))
				return 0;
				return 0;
			snd_printk(KERN_ERR
			dev_err(hdsp->card->dev,
				   "Hammerfall-DSP: No firmware loaded nor "
				   "No firmware loaded nor cached, please upload firmware.\n");
				   "cached, please upload firmware.\n");
			return -EIO;
			return -EIO;
		}
		}
		if (snd_hdsp_load_firmware_from_cache(hdsp) != 0) {
		if (snd_hdsp_load_firmware_from_cache(hdsp) != 0) {
			snd_printk(KERN_ERR
			dev_err(hdsp->card->dev,
				   "Hammerfall-DSP: Firmware loading from "
				   "Firmware loading from cache failed, please upload manually.\n");
				   "cache failed, please upload manually.\n");
			return -EIO;
			return -EIO;
		}
		}
	}
	}
@@ -888,7 +890,8 @@ static int hdsp_fifo_wait(struct hdsp *hdsp, int count, int timeout)
		udelay (100);
		udelay (100);
	}
	}


	snd_printk ("Hammerfall-DSP: wait for FIFO status <= %d failed after %d iterations\n",
	dev_warn(hdsp->card->dev,
		 "wait for FIFO status <= %d failed after %d iterations\n",
		    count, timeout);
		    count, timeout);
	return -1;
	return -1;
}
}
@@ -1005,7 +1008,9 @@ static int hdsp_spdif_sample_rate(struct hdsp *hdsp)
	default:
	default:
		break;
		break;
	}
	}
	snd_printk ("Hammerfall-DSP: unknown spdif frequency status; bits = 0x%x, status = 0x%x\n", rate_bits, status);
	dev_warn(hdsp->card->dev,
		 "unknown spdif frequency status; bits = 0x%x, status = 0x%x\n",
		 rate_bits, status);
	return 0;
	return 0;
}
}


@@ -1139,7 +1144,8 @@ static int hdsp_set_rate(struct hdsp *hdsp, int rate, int called_internally)
	if (!(hdsp->control_register & HDSP_ClockModeMaster)) {
	if (!(hdsp->control_register & HDSP_ClockModeMaster)) {
		if (called_internally) {
		if (called_internally) {
			/* request from ctl or card initialization */
			/* request from ctl or card initialization */
			snd_printk(KERN_ERR "Hammerfall-DSP: device is not running as a clock master: cannot set sample rate.\n");
			dev_err(hdsp->card->dev,
				"device is not running as a clock master: cannot set sample rate.\n");
			return -1;
			return -1;
		} else {
		} else {
			/* hw_param request while in AutoSync mode */
			/* hw_param request while in AutoSync mode */
@@ -1147,11 +1153,14 @@ static int hdsp_set_rate(struct hdsp *hdsp, int rate, int called_internally)
			int spdif_freq = hdsp_spdif_sample_rate(hdsp);
			int spdif_freq = hdsp_spdif_sample_rate(hdsp);


			if ((spdif_freq == external_freq*2) && (hdsp_autosync_ref(hdsp) >= HDSP_AUTOSYNC_FROM_ADAT1))
			if ((spdif_freq == external_freq*2) && (hdsp_autosync_ref(hdsp) >= HDSP_AUTOSYNC_FROM_ADAT1))
				snd_printk(KERN_INFO "Hammerfall-DSP: Detected ADAT in double speed mode\n");
				dev_info(hdsp->card->dev,
					 "Detected ADAT in double speed mode\n");
			else if (hdsp->io_type == H9632 && (spdif_freq == external_freq*4) && (hdsp_autosync_ref(hdsp) >= HDSP_AUTOSYNC_FROM_ADAT1))
			else if (hdsp->io_type == H9632 && (spdif_freq == external_freq*4) && (hdsp_autosync_ref(hdsp) >= HDSP_AUTOSYNC_FROM_ADAT1))
				snd_printk(KERN_INFO "Hammerfall-DSP: Detected ADAT in quad speed mode\n");
				dev_info(hdsp->card->dev,
					 "Detected ADAT in quad speed mode\n");
			else if (rate != external_freq) {
			else if (rate != external_freq) {
				snd_printk(KERN_INFO "Hammerfall-DSP: No AutoSync source for requested rate\n");
				dev_info(hdsp->card->dev,
					 "No AutoSync source for requested rate\n");
				return -1;
				return -1;
			}
			}
		}
		}
@@ -1223,7 +1232,8 @@ static int hdsp_set_rate(struct hdsp *hdsp, int rate, int called_internally)
	}
	}


	if (reject_if_open && (hdsp->capture_pid >= 0 || hdsp->playback_pid >= 0)) {
	if (reject_if_open && (hdsp->capture_pid >= 0 || hdsp->playback_pid >= 0)) {
		snd_printk ("Hammerfall-DSP: cannot change speed mode (capture PID = %d, playback PID = %d)\n",
		dev_warn(hdsp->card->dev,
			 "cannot change speed mode (capture PID = %d, playback PID = %d)\n",
			    hdsp->capture_pid,
			    hdsp->capture_pid,
			    hdsp->playback_pid);
			    hdsp->playback_pid);
		return -EBUSY;
		return -EBUSY;
@@ -3785,7 +3795,8 @@ static int snd_hdsp_initialize_memory(struct hdsp *hdsp)
	    snd_hammerfall_get_buffer(hdsp->pci, &hdsp->playback_dma_buf, HDSP_DMA_AREA_BYTES) < 0) {
	    snd_hammerfall_get_buffer(hdsp->pci, &hdsp->playback_dma_buf, HDSP_DMA_AREA_BYTES) < 0) {
		if (hdsp->capture_dma_buf.area)
		if (hdsp->capture_dma_buf.area)
			snd_dma_free_pages(&hdsp->capture_dma_buf);
			snd_dma_free_pages(&hdsp->capture_dma_buf);
		printk(KERN_ERR "%s: no buffers available\n", hdsp->card_name);
		dev_err(hdsp->card->dev,
			"%s: no buffers available\n", hdsp->card_name);
		return -ENOMEM;
		return -ENOMEM;
	}
	}


@@ -4747,7 +4758,8 @@ static int snd_hdsp_hwdep_ioctl(struct snd_hwdep *hw, struct file *file, unsigne
			return err;
			return err;


		if (!(hdsp->state & HDSP_FirmwareLoaded)) {
		if (!(hdsp->state & HDSP_FirmwareLoaded)) {
			snd_printk(KERN_ERR "Hammerfall-DSP: firmware needs to be uploaded to the card.\n");
			dev_err(hdsp->card->dev,
				"firmware needs to be uploaded to the card.\n");
			return -EINVAL;
			return -EINVAL;
		}
		}


@@ -4858,7 +4870,8 @@ static int snd_hdsp_hwdep_ioctl(struct snd_hwdep *hw, struct file *file, unsigne
		if (hdsp->state & (HDSP_FirmwareCached | HDSP_FirmwareLoaded))
		if (hdsp->state & (HDSP_FirmwareCached | HDSP_FirmwareLoaded))
			return -EBUSY;
			return -EBUSY;


		snd_printk(KERN_INFO "Hammerfall-DSP: initializing firmware upload\n");
		dev_info(hdsp->card->dev,
			 "initializing firmware upload\n");
		firmware = (struct hdsp_firmware __user *)argp;
		firmware = (struct hdsp_firmware __user *)argp;


		if (get_user(firmware_data, &firmware->firmware_data))
		if (get_user(firmware_data, &firmware->firmware_data))
@@ -4893,7 +4906,8 @@ static int snd_hdsp_hwdep_ioctl(struct snd_hwdep *hw, struct file *file, unsigne
			snd_hdsp_initialize_midi_flush(hdsp);
			snd_hdsp_initialize_midi_flush(hdsp);


			if ((err = snd_hdsp_create_alsa_devices(hdsp->card, hdsp)) < 0) {
			if ((err = snd_hdsp_create_alsa_devices(hdsp->card, hdsp)) < 0) {
				snd_printk(KERN_ERR "Hammerfall-DSP: error creating alsa devices\n");
				dev_err(hdsp->card->dev,
					"error creating alsa devices\n");
				return err;
				return err;
			}
			}
		}
		}
@@ -4983,7 +4997,8 @@ static int snd_hdsp_enable_io (struct hdsp *hdsp)
	int i;
	int i;


	if (hdsp_fifo_wait (hdsp, 0, 100)) {
	if (hdsp_fifo_wait (hdsp, 0, 100)) {
		snd_printk(KERN_ERR "Hammerfall-DSP: enable_io fifo_wait failed\n");
		dev_err(hdsp->card->dev,
			"enable_io fifo_wait failed\n");
		return -EIO;
		return -EIO;
	}
	}


@@ -5057,25 +5072,29 @@ static int snd_hdsp_create_alsa_devices(struct snd_card *card, struct hdsp *hdsp
	int err;
	int err;


	if ((err = snd_hdsp_create_pcm(card, hdsp)) < 0) {
	if ((err = snd_hdsp_create_pcm(card, hdsp)) < 0) {
		snd_printk(KERN_ERR "Hammerfall-DSP: Error creating pcm interface\n");
		dev_err(card->dev,
			"Error creating pcm interface\n");
		return err;
		return err;
	}
	}




	if ((err = snd_hdsp_create_midi(card, hdsp, 0)) < 0) {
	if ((err = snd_hdsp_create_midi(card, hdsp, 0)) < 0) {
		snd_printk(KERN_ERR "Hammerfall-DSP: Error creating first midi interface\n");
		dev_err(card->dev,
			"Error creating first midi interface\n");
		return err;
		return err;
	}
	}


	if (hdsp->io_type == Digiface || hdsp->io_type == H9652) {
	if (hdsp->io_type == Digiface || hdsp->io_type == H9652) {
		if ((err = snd_hdsp_create_midi(card, hdsp, 1)) < 0) {
		if ((err = snd_hdsp_create_midi(card, hdsp, 1)) < 0) {
			snd_printk(KERN_ERR "Hammerfall-DSP: Error creating second midi interface\n");
			dev_err(card->dev,
				"Error creating second midi interface\n");
			return err;
			return err;
		}
		}
	}
	}


	if ((err = snd_hdsp_create_controls(card, hdsp)) < 0) {
	if ((err = snd_hdsp_create_controls(card, hdsp)) < 0) {
		snd_printk(KERN_ERR "Hammerfall-DSP: Error creating ctl interface\n");
		dev_err(card->dev,
			"Error creating ctl interface\n");
		return err;
		return err;
	}
	}


@@ -5088,7 +5107,8 @@ static int snd_hdsp_create_alsa_devices(struct snd_card *card, struct hdsp *hdsp
	hdsp->playback_substream = NULL;
	hdsp->playback_substream = NULL;


	if ((err = snd_hdsp_set_defaults(hdsp)) < 0) {
	if ((err = snd_hdsp_set_defaults(hdsp)) < 0) {
		snd_printk(KERN_ERR "Hammerfall-DSP: Error setting default values\n");
		dev_err(card->dev,
			"Error setting default values\n");
		return err;
		return err;
	}
	}


@@ -5098,7 +5118,8 @@ static int snd_hdsp_create_alsa_devices(struct snd_card *card, struct hdsp *hdsp
			hdsp->port, hdsp->irq);
			hdsp->port, hdsp->irq);


		if ((err = snd_card_register(card)) < 0) {
		if ((err = snd_card_register(card)) < 0) {
			snd_printk(KERN_ERR "Hammerfall-DSP: error registering card\n");
			dev_err(card->dev,
				"error registering card\n");
			return err;
			return err;
		}
		}
		hdsp->state |= HDSP_InitializationComplete;
		hdsp->state |= HDSP_InitializationComplete;
@@ -5141,16 +5162,19 @@ static int hdsp_request_fw_loader(struct hdsp *hdsp)
			fwfile = "digiface_firmware_rev11.bin";
			fwfile = "digiface_firmware_rev11.bin";
		break;
		break;
	default:
	default:
		snd_printk(KERN_ERR "Hammerfall-DSP: invalid io_type %d\n", hdsp->io_type);
		dev_err(hdsp->card->dev,
			"invalid io_type %d\n", hdsp->io_type);
		return -EINVAL;
		return -EINVAL;
	}
	}


	if (request_firmware(&fw, fwfile, &hdsp->pci->dev)) {
	if (request_firmware(&fw, fwfile, &hdsp->pci->dev)) {
		snd_printk(KERN_ERR "Hammerfall-DSP: cannot load firmware %s\n", fwfile);
		dev_err(hdsp->card->dev,
			"cannot load firmware %s\n", fwfile);
		return -ENOENT;
		return -ENOENT;
	}
	}
	if (fw->size < HDSP_FIRMWARE_SIZE) {
	if (fw->size < HDSP_FIRMWARE_SIZE) {
		snd_printk(KERN_ERR "Hammerfall-DSP: too short firmware size %d (expected %d)\n",
		dev_err(hdsp->card->dev,
			"too short firmware size %d (expected %d)\n",
			   (int)fw->size, HDSP_FIRMWARE_SIZE);
			   (int)fw->size, HDSP_FIRMWARE_SIZE);
		return -EINVAL;
		return -EINVAL;
	}
	}
@@ -5167,13 +5191,15 @@ static int hdsp_request_fw_loader(struct hdsp *hdsp)
			return err;
			return err;


		if ((err = snd_hdsp_create_hwdep(hdsp->card, hdsp)) < 0) {
		if ((err = snd_hdsp_create_hwdep(hdsp->card, hdsp)) < 0) {
			snd_printk(KERN_ERR "Hammerfall-DSP: error creating hwdep device\n");
			dev_err(hdsp->card->dev,
				"error creating hwdep device\n");
			return err;
			return err;
		}
		}
		snd_hdsp_initialize_channels(hdsp);
		snd_hdsp_initialize_channels(hdsp);
		snd_hdsp_initialize_midi_flush(hdsp);
		snd_hdsp_initialize_midi_flush(hdsp);
		if ((err = snd_hdsp_create_alsa_devices(hdsp->card, hdsp)) < 0) {
		if ((err = snd_hdsp_create_alsa_devices(hdsp->card, hdsp)) < 0) {
			snd_printk(KERN_ERR "Hammerfall-DSP: error creating alsa devices\n");
			dev_err(hdsp->card->dev,
				"error creating alsa devices\n");
			return err;
			return err;
		}
		}
	}
	}
@@ -5249,13 +5275,14 @@ static int snd_hdsp_create(struct snd_card *card,
		return err;
		return err;
	hdsp->port = pci_resource_start(pci, 0);
	hdsp->port = pci_resource_start(pci, 0);
	if ((hdsp->iobase = ioremap_nocache(hdsp->port, HDSP_IO_EXTENT)) == NULL) {
	if ((hdsp->iobase = ioremap_nocache(hdsp->port, HDSP_IO_EXTENT)) == NULL) {
		snd_printk(KERN_ERR "Hammerfall-DSP: unable to remap region 0x%lx-0x%lx\n", hdsp->port, hdsp->port + HDSP_IO_EXTENT - 1);
		dev_err(hdsp->card->dev, "unable to remap region 0x%lx-0x%lx\n",
			hdsp->port, hdsp->port + HDSP_IO_EXTENT - 1);
		return -EBUSY;
		return -EBUSY;
	}
	}


	if (request_irq(pci->irq, snd_hdsp_interrupt, IRQF_SHARED,
	if (request_irq(pci->irq, snd_hdsp_interrupt, IRQF_SHARED,
			KBUILD_MODNAME, hdsp)) {
			KBUILD_MODNAME, hdsp)) {
		snd_printk(KERN_ERR "Hammerfall-DSP: unable to use IRQ %d\n", pci->irq);
		dev_err(hdsp->card->dev, "unable to use IRQ %d\n", pci->irq);
		return -EBUSY;
		return -EBUSY;
	}
	}


@@ -5281,17 +5308,20 @@ static int snd_hdsp_create(struct snd_card *card,
				   if userspace is not ready for
				   if userspace is not ready for
				   firmware upload
				   firmware upload
				*/
				*/
				snd_printk(KERN_ERR "Hammerfall-DSP: couldn't get firmware from userspace. try using hdsploader\n");
				dev_err(hdsp->card->dev,
					"couldn't get firmware from userspace. try using hdsploader\n");
			else
			else
				/* init is complete, we return */
				/* init is complete, we return */
				return 0;
				return 0;
			/* we defer initialization */
			/* we defer initialization */
			snd_printk(KERN_INFO "Hammerfall-DSP: card initialization pending : waiting for firmware\n");
			dev_info(hdsp->card->dev,
				 "card initialization pending : waiting for firmware\n");
			if ((err = snd_hdsp_create_hwdep(card, hdsp)) < 0)
			if ((err = snd_hdsp_create_hwdep(card, hdsp)) < 0)
				return err;
				return err;
			return 0;
			return 0;
		} else {
		} else {
			snd_printk(KERN_INFO "Hammerfall-DSP: Firmware already present, initializing card.\n");
			dev_info(hdsp->card->dev,
				 "Firmware already present, initializing card.\n");
			if (hdsp_read(hdsp, HDSP_status2Register) & HDSP_version2)
			if (hdsp_read(hdsp, HDSP_status2Register) & HDSP_version2)
				hdsp->io_type = RPM;
				hdsp->io_type = RPM;
			else if (hdsp_read(hdsp, HDSP_status2Register) & HDSP_version1)
			else if (hdsp_read(hdsp, HDSP_status2Register) & HDSP_version1)