diff options
| -rw-r--r-- | sound/pci/rme9652/hdsp.c | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/sound/pci/rme9652/hdsp.c b/sound/pci/rme9652/hdsp.c index d680114b3e44..736246f98acc 100644 --- a/sound/pci/rme9652/hdsp.c +++ b/sound/pci/rme9652/hdsp.c | |||
| @@ -4548,11 +4548,20 @@ static int snd_hdsp_hwdep_ioctl(struct snd_hwdep *hw, struct file *file, unsigne | |||
| 4548 | { | 4548 | { |
| 4549 | struct hdsp *hdsp = (struct hdsp *)hw->private_data; | 4549 | struct hdsp *hdsp = (struct hdsp *)hw->private_data; |
| 4550 | void __user *argp = (void __user *)arg; | 4550 | void __user *argp = (void __user *)arg; |
| 4551 | int err; | ||
| 4551 | 4552 | ||
| 4552 | switch (cmd) { | 4553 | switch (cmd) { |
| 4553 | case SNDRV_HDSP_IOCTL_GET_PEAK_RMS: { | 4554 | case SNDRV_HDSP_IOCTL_GET_PEAK_RMS: { |
| 4554 | struct hdsp_peak_rms __user *peak_rms = (struct hdsp_peak_rms __user *)arg; | 4555 | struct hdsp_peak_rms __user *peak_rms = (struct hdsp_peak_rms __user *)arg; |
| 4555 | 4556 | ||
| 4557 | err = hdsp_check_for_iobox(hdsp); | ||
| 4558 | if (err < 0) | ||
| 4559 | return err; | ||
| 4560 | |||
| 4561 | err = hdsp_check_for_firmware(hdsp, 1); | ||
| 4562 | if (err < 0) | ||
| 4563 | return err; | ||
| 4564 | |||
| 4556 | if (!(hdsp->state & HDSP_FirmwareLoaded)) { | 4565 | if (!(hdsp->state & HDSP_FirmwareLoaded)) { |
| 4557 | snd_printk(KERN_ERR "Hammerfall-DSP: firmware needs to be uploaded to the card.\n"); | 4566 | snd_printk(KERN_ERR "Hammerfall-DSP: firmware needs to be uploaded to the card.\n"); |
| 4558 | return -EINVAL; | 4567 | return -EINVAL; |
| @@ -4572,10 +4581,14 @@ static int snd_hdsp_hwdep_ioctl(struct snd_hwdep *hw, struct file *file, unsigne | |||
| 4572 | unsigned long flags; | 4581 | unsigned long flags; |
| 4573 | int i; | 4582 | int i; |
| 4574 | 4583 | ||
| 4575 | if (!(hdsp->state & HDSP_FirmwareLoaded)) { | 4584 | err = hdsp_check_for_iobox(hdsp); |
| 4576 | snd_printk(KERN_ERR "Hammerfall-DSP: Firmware needs to be uploaded to the card.\n"); | 4585 | if (err < 0) |
| 4577 | return -EINVAL; | 4586 | return err; |
| 4578 | } | 4587 | |
| 4588 | err = hdsp_check_for_firmware(hdsp, 1); | ||
| 4589 | if (err < 0) | ||
| 4590 | return err; | ||
| 4591 | |||
| 4579 | spin_lock_irqsave(&hdsp->lock, flags); | 4592 | spin_lock_irqsave(&hdsp->lock, flags); |
| 4580 | info.pref_sync_ref = (unsigned char)hdsp_pref_sync_ref(hdsp); | 4593 | info.pref_sync_ref = (unsigned char)hdsp_pref_sync_ref(hdsp); |
| 4581 | info.wordclock_sync_check = (unsigned char)hdsp_wc_sync_check(hdsp); | 4594 | info.wordclock_sync_check = (unsigned char)hdsp_wc_sync_check(hdsp); |
