Commit 77c9a7be authored by Jaroslav Kysela's avatar Jaroslav Kysela

[ALSA] Fix compilation errors

Digigram VX core,MIXART driver
Fix compilation errors when built without hotplug fw loader.
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent a7c9c7df
......@@ -137,7 +137,7 @@ static int vx_hwdep_dsp_status(snd_hwdep_t *hw, snd_hwdep_dsp_status_t *info)
return 0;
}
static void free_fw(struct firmware *fw)
static void free_fw(const struct firmware *fw)
{
if (fw) {
vfree(fw->data);
......@@ -180,7 +180,7 @@ static int vx_hwdep_dsp_load(snd_hwdep_t *hw, snd_hwdep_dsp_image_t *dsp)
return err;
}
#ifdef CONFIG_PM
chip->firmware[index] = fw;
vx->firmware[index] = fw;
#else
free_fw(fw);
#endif
......
......@@ -525,8 +525,6 @@ static int mixart_dsp_load(mixart_mgr_t* mgr, int index, const struct firmware *
#ifdef SND_MIXART_FW_LOADER
#include <linux/firmware.h>
int snd_mixart_setup_firmware(mixart_mgr_t *mgr)
{
static char *fw_files[3] = {
......@@ -588,19 +586,19 @@ static int mixart_hwdep_dsp_load(snd_hwdep_t *hw, snd_hwdep_dsp_image_t *dsp)
struct firmware fw;
int err;
fw->size = dsp->length;
fw->data = vmalloc(dsp->length);
if (! fw->data) {
fw.size = dsp->length;
fw.data = vmalloc(dsp->length);
if (! fw.data) {
snd_printk(KERN_ERR "miXart: cannot allocate image size %d\n",
(int)dsp->length);
return -ENOMEM;
}
if (copy_from_user(fw->data, dsp->image, dsp->length)) {
vfree(fw->data);
if (copy_from_user(fw.data, dsp->image, dsp->length)) {
vfree(fw.data);
return -EFAULT;
}
err = mixart_dsp_load(mgr, dsp->index, &fw);
vfree(fw->data);
vfree(fw.data);
return err;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment