Commit 6aa63a25 authored by Mark Brown's avatar Mark Brown

Merge remote-tracking branches 'asoc/topic/omap', 'asoc/topic/oom' and...

Merge remote-tracking branches 'asoc/topic/omap', 'asoc/topic/oom' and 'asoc/topic/pxa' into asoc-next
...@@ -152,9 +152,9 @@ static inline void pxa_ac97_cold_pxa27x(void) ...@@ -152,9 +152,9 @@ static inline void pxa_ac97_cold_pxa27x(void)
gsr_bits = 0; gsr_bits = 0;
/* PXA27x Developers Manual section 13.5.2.2.1 */ /* PXA27x Developers Manual section 13.5.2.2.1 */
clk_enable(ac97conf_clk); clk_prepare_enable(ac97conf_clk);
udelay(5); udelay(5);
clk_disable(ac97conf_clk); clk_disable_unprepare(ac97conf_clk);
GCR = GCR_COLD_RST | GCR_WARM_RST; GCR = GCR_COLD_RST | GCR_WARM_RST;
} }
#endif #endif
...@@ -299,14 +299,14 @@ static irqreturn_t pxa2xx_ac97_irq(int irq, void *dev_id) ...@@ -299,14 +299,14 @@ static irqreturn_t pxa2xx_ac97_irq(int irq, void *dev_id)
int pxa2xx_ac97_hw_suspend(void) int pxa2xx_ac97_hw_suspend(void)
{ {
GCR |= GCR_ACLINK_OFF; GCR |= GCR_ACLINK_OFF;
clk_disable(ac97_clk); clk_disable_unprepare(ac97_clk);
return 0; return 0;
} }
EXPORT_SYMBOL_GPL(pxa2xx_ac97_hw_suspend); EXPORT_SYMBOL_GPL(pxa2xx_ac97_hw_suspend);
int pxa2xx_ac97_hw_resume(void) int pxa2xx_ac97_hw_resume(void)
{ {
clk_enable(ac97_clk); clk_prepare_enable(ac97_clk);
return 0; return 0;
} }
EXPORT_SYMBOL_GPL(pxa2xx_ac97_hw_resume); EXPORT_SYMBOL_GPL(pxa2xx_ac97_hw_resume);
...@@ -368,7 +368,7 @@ int pxa2xx_ac97_hw_probe(struct platform_device *dev) ...@@ -368,7 +368,7 @@ int pxa2xx_ac97_hw_probe(struct platform_device *dev)
goto err_clk; goto err_clk;
} }
ret = clk_enable(ac97_clk); ret = clk_prepare_enable(ac97_clk);
if (ret) if (ret)
goto err_clk2; goto err_clk2;
...@@ -403,7 +403,7 @@ void pxa2xx_ac97_hw_remove(struct platform_device *dev) ...@@ -403,7 +403,7 @@ void pxa2xx_ac97_hw_remove(struct platform_device *dev)
clk_put(ac97conf_clk); clk_put(ac97conf_clk);
ac97conf_clk = NULL; ac97conf_clk = NULL;
} }
clk_disable(ac97_clk); clk_disable_unprepare(ac97_clk);
clk_put(ac97_clk); clk_put(ac97_clk);
ac97_clk = NULL; ac97_clk = NULL;
} }
......
...@@ -664,10 +664,8 @@ static int cs4270_i2c_probe(struct i2c_client *i2c_client, ...@@ -664,10 +664,8 @@ static int cs4270_i2c_probe(struct i2c_client *i2c_client,
cs4270 = devm_kzalloc(&i2c_client->dev, sizeof(struct cs4270_private), cs4270 = devm_kzalloc(&i2c_client->dev, sizeof(struct cs4270_private),
GFP_KERNEL); GFP_KERNEL);
if (!cs4270) { if (!cs4270)
dev_err(&i2c_client->dev, "could not allocate codec\n");
return -ENOMEM; return -ENOMEM;
}
/* get the power supply regulators */ /* get the power supply regulators */
for (i = 0; i < ARRAY_SIZE(supply_names); i++) for (i = 0; i < ARRAY_SIZE(supply_names); i++)
......
...@@ -1408,10 +1408,8 @@ static int cs42l73_i2c_probe(struct i2c_client *i2c_client, ...@@ -1408,10 +1408,8 @@ static int cs42l73_i2c_probe(struct i2c_client *i2c_client,
cs42l73 = devm_kzalloc(&i2c_client->dev, sizeof(struct cs42l73_private), cs42l73 = devm_kzalloc(&i2c_client->dev, sizeof(struct cs42l73_private),
GFP_KERNEL); GFP_KERNEL);
if (!cs42l73) { if (!cs42l73)
dev_err(&i2c_client->dev, "could not allocate codec\n");
return -ENOMEM; return -ENOMEM;
}
cs42l73->regmap = devm_regmap_init_i2c(i2c_client, &cs42l73_regmap); cs42l73->regmap = devm_regmap_init_i2c(i2c_client, &cs42l73_regmap);
if (IS_ERR(cs42l73->regmap)) { if (IS_ERR(cs42l73->regmap)) {
......
...@@ -843,10 +843,8 @@ static int ldo_regulator_register(struct snd_soc_codec *codec, ...@@ -843,10 +843,8 @@ static int ldo_regulator_register(struct snd_soc_codec *codec,
ldo = kzalloc(sizeof(struct ldo_regulator), GFP_KERNEL); ldo = kzalloc(sizeof(struct ldo_regulator), GFP_KERNEL);
if (!ldo) { if (!ldo)
dev_err(codec->dev, "failed to allocate ldo_regulator\n");
return -ENOMEM; return -ENOMEM;
}
ldo->desc.name = kstrdup(dev_name(codec->dev), GFP_KERNEL); ldo->desc.name = kstrdup(dev_name(codec->dev), GFP_KERNEL);
if (!ldo->desc.name) { if (!ldo->desc.name) {
......
...@@ -380,10 +380,8 @@ static int sta529_i2c_probe(struct i2c_client *i2c, ...@@ -380,10 +380,8 @@ static int sta529_i2c_probe(struct i2c_client *i2c,
return -EINVAL; return -EINVAL;
sta529 = devm_kzalloc(&i2c->dev, sizeof(struct sta529), GFP_KERNEL); sta529 = devm_kzalloc(&i2c->dev, sizeof(struct sta529), GFP_KERNEL);
if (sta529 == NULL) { if (!sta529)
dev_err(&i2c->dev, "Can not allocate memory\n");
return -ENOMEM; return -ENOMEM;
}
sta529->regmap = devm_regmap_init_i2c(i2c, &sta529_regmap); sta529->regmap = devm_regmap_init_i2c(i2c, &sta529_regmap);
if (IS_ERR(sta529->regmap)) { if (IS_ERR(sta529->regmap)) {
......
...@@ -1477,10 +1477,8 @@ static int aic3x_i2c_probe(struct i2c_client *i2c, ...@@ -1477,10 +1477,8 @@ static int aic3x_i2c_probe(struct i2c_client *i2c,
u32 value; u32 value;
aic3x = devm_kzalloc(&i2c->dev, sizeof(struct aic3x_priv), GFP_KERNEL); aic3x = devm_kzalloc(&i2c->dev, sizeof(struct aic3x_priv), GFP_KERNEL);
if (aic3x == NULL) { if (!aic3x)
dev_err(&i2c->dev, "failed to create private data\n");
return -ENOMEM; return -ENOMEM;
}
aic3x->regmap = devm_regmap_init_i2c(i2c, &aic3x_regmap); aic3x->regmap = devm_regmap_init_i2c(i2c, &aic3x_regmap);
if (IS_ERR(aic3x->regmap)) { if (IS_ERR(aic3x->regmap)) {
...@@ -1498,10 +1496,8 @@ static int aic3x_i2c_probe(struct i2c_client *i2c, ...@@ -1498,10 +1496,8 @@ static int aic3x_i2c_probe(struct i2c_client *i2c,
} else if (np) { } else if (np) {
ai3x_setup = devm_kzalloc(&i2c->dev, sizeof(*ai3x_setup), ai3x_setup = devm_kzalloc(&i2c->dev, sizeof(*ai3x_setup),
GFP_KERNEL); GFP_KERNEL);
if (ai3x_setup == NULL) { if (!ai3x_setup)
dev_err(&i2c->dev, "failed to create private data\n");
return -ENOMEM; return -ENOMEM;
}
ret = of_get_named_gpio(np, "gpio-reset", 0); ret = of_get_named_gpio(np, "gpio-reset", 0);
if (ret >= 0) if (ret >= 0)
......
...@@ -381,10 +381,8 @@ static int tpa6130a2_probe(struct i2c_client *client, ...@@ -381,10 +381,8 @@ static int tpa6130a2_probe(struct i2c_client *client,
dev = &client->dev; dev = &client->dev;
data = devm_kzalloc(&client->dev, sizeof(*data), GFP_KERNEL); data = devm_kzalloc(&client->dev, sizeof(*data), GFP_KERNEL);
if (data == NULL) { if (!data)
dev_err(dev, "Can not allocate memory\n");
return -ENOMEM; return -ENOMEM;
}
if (pdata) { if (pdata) {
data->power_gpio = pdata->power_gpio; data->power_gpio = pdata->power_gpio;
......
...@@ -2161,10 +2161,8 @@ static int twl4030_soc_probe(struct snd_soc_codec *codec) ...@@ -2161,10 +2161,8 @@ static int twl4030_soc_probe(struct snd_soc_codec *codec)
twl4030 = devm_kzalloc(codec->dev, sizeof(struct twl4030_priv), twl4030 = devm_kzalloc(codec->dev, sizeof(struct twl4030_priv),
GFP_KERNEL); GFP_KERNEL);
if (twl4030 == NULL) { if (!twl4030)
dev_err(codec->dev, "Can not allocate memory\n");
return -ENOMEM; return -ENOMEM;
}
snd_soc_codec_set_drvdata(codec, twl4030); snd_soc_codec_set_drvdata(codec, twl4030);
/* Set the defaults, and power up the codec */ /* Set the defaults, and power up the codec */
twl4030->sysclk = twl4030_audio_get_mclk() / 1000; twl4030->sysclk = twl4030_audio_get_mclk() / 1000;
......
...@@ -461,10 +461,8 @@ static int wl1273_probe(struct snd_soc_codec *codec) ...@@ -461,10 +461,8 @@ static int wl1273_probe(struct snd_soc_codec *codec)
} }
wl1273 = kzalloc(sizeof(struct wl1273_priv), GFP_KERNEL); wl1273 = kzalloc(sizeof(struct wl1273_priv), GFP_KERNEL);
if (wl1273 == NULL) { if (!wl1273)
dev_err(codec->dev, "Cannot allocate memory.\n");
return -ENOMEM; return -ENOMEM;
}
wl1273->mode = WL1273_MODE_BT; wl1273->mode = WL1273_MODE_BT;
wl1273->core = *core; wl1273->core = *core;
......
...@@ -413,7 +413,6 @@ static int wm0010_firmware_load(const char *name, struct snd_soc_codec *codec) ...@@ -413,7 +413,6 @@ static int wm0010_firmware_load(const char *name, struct snd_soc_codec *codec)
xfer = kzalloc(sizeof(*xfer), GFP_KERNEL); xfer = kzalloc(sizeof(*xfer), GFP_KERNEL);
if (!xfer) { if (!xfer) {
dev_err(codec->dev, "Failed to allocate xfer\n");
ret = -ENOMEM; ret = -ENOMEM;
goto abort; goto abort;
} }
...@@ -423,8 +422,6 @@ static int wm0010_firmware_load(const char *name, struct snd_soc_codec *codec) ...@@ -423,8 +422,6 @@ static int wm0010_firmware_load(const char *name, struct snd_soc_codec *codec)
out = kzalloc(len, GFP_KERNEL | GFP_DMA); out = kzalloc(len, GFP_KERNEL | GFP_DMA);
if (!out) { if (!out) {
dev_err(codec->dev,
"Failed to allocate RX buffer\n");
ret = -ENOMEM; ret = -ENOMEM;
goto abort1; goto abort1;
} }
...@@ -432,8 +429,6 @@ static int wm0010_firmware_load(const char *name, struct snd_soc_codec *codec) ...@@ -432,8 +429,6 @@ static int wm0010_firmware_load(const char *name, struct snd_soc_codec *codec)
img = kzalloc(len, GFP_KERNEL | GFP_DMA); img = kzalloc(len, GFP_KERNEL | GFP_DMA);
if (!img) { if (!img) {
dev_err(codec->dev,
"Failed to allocate image buffer\n");
ret = -ENOMEM; ret = -ENOMEM;
goto abort1; goto abort1;
} }
...@@ -526,14 +521,12 @@ static int wm0010_stage2_load(struct snd_soc_codec *codec) ...@@ -526,14 +521,12 @@ static int wm0010_stage2_load(struct snd_soc_codec *codec)
/* Copy to local buffer first as vmalloc causes problems for dma */ /* Copy to local buffer first as vmalloc causes problems for dma */
img = kzalloc(fw->size, GFP_KERNEL | GFP_DMA); img = kzalloc(fw->size, GFP_KERNEL | GFP_DMA);
if (!img) { if (!img) {
dev_err(codec->dev, "Failed to allocate image buffer\n");
ret = -ENOMEM; ret = -ENOMEM;
goto abort2; goto abort2;
} }
out = kzalloc(fw->size, GFP_KERNEL | GFP_DMA); out = kzalloc(fw->size, GFP_KERNEL | GFP_DMA);
if (!out) { if (!out) {
dev_err(codec->dev, "Failed to allocate output buffer\n");
ret = -ENOMEM; ret = -ENOMEM;
goto abort1; goto abort1;
} }
...@@ -679,11 +672,8 @@ static int wm0010_boot(struct snd_soc_codec *codec) ...@@ -679,11 +672,8 @@ static int wm0010_boot(struct snd_soc_codec *codec)
} }
img_swap = kzalloc(len, GFP_KERNEL | GFP_DMA); img_swap = kzalloc(len, GFP_KERNEL | GFP_DMA);
if (!img_swap) { if (!img_swap)
dev_err(codec->dev,
"Failed to allocate image buffer\n");
goto abort; goto abort;
}
/* We need to re-order for 0010 */ /* We need to re-order for 0010 */
byte_swap_64((u64 *)&pll_rec, img_swap, len); byte_swap_64((u64 *)&pll_rec, img_swap, len);
......
...@@ -164,7 +164,6 @@ static int wm1250_ev1_pdata(struct i2c_client *i2c) ...@@ -164,7 +164,6 @@ static int wm1250_ev1_pdata(struct i2c_client *i2c)
wm1250 = devm_kzalloc(&i2c->dev, sizeof(*wm1250), GFP_KERNEL); wm1250 = devm_kzalloc(&i2c->dev, sizeof(*wm1250), GFP_KERNEL);
if (!wm1250) { if (!wm1250) {
dev_err(&i2c->dev, "Unable to allocate private data\n");
ret = -ENOMEM; ret = -ENOMEM;
goto err; goto err;
} }
......
...@@ -826,10 +826,8 @@ static int wm2000_i2c_probe(struct i2c_client *i2c, ...@@ -826,10 +826,8 @@ static int wm2000_i2c_probe(struct i2c_client *i2c,
wm2000 = devm_kzalloc(&i2c->dev, sizeof(struct wm2000_priv), wm2000 = devm_kzalloc(&i2c->dev, sizeof(struct wm2000_priv),
GFP_KERNEL); GFP_KERNEL);
if (wm2000 == NULL) { if (!wm2000)
dev_err(&i2c->dev, "Unable to allocate private data\n");
return -ENOMEM; return -ENOMEM;
}
mutex_init(&wm2000->lock); mutex_init(&wm2000->lock);
......
...@@ -2013,12 +2013,8 @@ static void wm8904_handle_pdata(struct snd_soc_codec *codec) ...@@ -2013,12 +2013,8 @@ static void wm8904_handle_pdata(struct snd_soc_codec *codec)
/* We need an array of texts for the enum API */ /* We need an array of texts for the enum API */
wm8904->drc_texts = kmalloc(sizeof(char *) wm8904->drc_texts = kmalloc(sizeof(char *)
* pdata->num_drc_cfgs, GFP_KERNEL); * pdata->num_drc_cfgs, GFP_KERNEL);
if (!wm8904->drc_texts) { if (!wm8904->drc_texts)
dev_err(codec->dev,
"Failed to allocate %d DRC config texts\n",
pdata->num_drc_cfgs);
return; return;
}
for (i = 0; i < pdata->num_drc_cfgs; i++) for (i = 0; i < pdata->num_drc_cfgs; i++)
wm8904->drc_texts[i] = pdata->drc_cfgs[i].name; wm8904->drc_texts[i] = pdata->drc_cfgs[i].name;
......
...@@ -934,12 +934,8 @@ void wm8958_dsp2_init(struct snd_soc_codec *codec) ...@@ -934,12 +934,8 @@ void wm8958_dsp2_init(struct snd_soc_codec *codec)
/* We need an array of texts for the enum API */ /* We need an array of texts for the enum API */
wm8994->mbc_texts = kmalloc(sizeof(char *) wm8994->mbc_texts = kmalloc(sizeof(char *)
* pdata->num_mbc_cfgs, GFP_KERNEL); * pdata->num_mbc_cfgs, GFP_KERNEL);
if (!wm8994->mbc_texts) { if (!wm8994->mbc_texts)
dev_err(wm8994->hubs.codec->dev,
"Failed to allocate %d MBC config texts\n",
pdata->num_mbc_cfgs);
return; return;
}
for (i = 0; i < pdata->num_mbc_cfgs; i++) for (i = 0; i < pdata->num_mbc_cfgs; i++)
wm8994->mbc_texts[i] = pdata->mbc_cfgs[i].name; wm8994->mbc_texts[i] = pdata->mbc_cfgs[i].name;
...@@ -963,12 +959,8 @@ void wm8958_dsp2_init(struct snd_soc_codec *codec) ...@@ -963,12 +959,8 @@ void wm8958_dsp2_init(struct snd_soc_codec *codec)
/* We need an array of texts for the enum API */ /* We need an array of texts for the enum API */
wm8994->vss_texts = kmalloc(sizeof(char *) wm8994->vss_texts = kmalloc(sizeof(char *)
* pdata->num_vss_cfgs, GFP_KERNEL); * pdata->num_vss_cfgs, GFP_KERNEL);
if (!wm8994->vss_texts) { if (!wm8994->vss_texts)
dev_err(wm8994->hubs.codec->dev,
"Failed to allocate %d VSS config texts\n",
pdata->num_vss_cfgs);
return; return;
}
for (i = 0; i < pdata->num_vss_cfgs; i++) for (i = 0; i < pdata->num_vss_cfgs; i++)
wm8994->vss_texts[i] = pdata->vss_cfgs[i].name; wm8994->vss_texts[i] = pdata->vss_cfgs[i].name;
...@@ -993,12 +985,8 @@ void wm8958_dsp2_init(struct snd_soc_codec *codec) ...@@ -993,12 +985,8 @@ void wm8958_dsp2_init(struct snd_soc_codec *codec)
/* We need an array of texts for the enum API */ /* We need an array of texts for the enum API */
wm8994->vss_hpf_texts = kmalloc(sizeof(char *) wm8994->vss_hpf_texts = kmalloc(sizeof(char *)
* pdata->num_vss_hpf_cfgs, GFP_KERNEL); * pdata->num_vss_hpf_cfgs, GFP_KERNEL);
if (!wm8994->vss_hpf_texts) { if (!wm8994->vss_hpf_texts)
dev_err(wm8994->hubs.codec->dev,
"Failed to allocate %d VSS HPF config texts\n",
pdata->num_vss_hpf_cfgs);
return; return;
}
for (i = 0; i < pdata->num_vss_hpf_cfgs; i++) for (i = 0; i < pdata->num_vss_hpf_cfgs; i++)
wm8994->vss_hpf_texts[i] = pdata->vss_hpf_cfgs[i].name; wm8994->vss_hpf_texts[i] = pdata->vss_hpf_cfgs[i].name;
...@@ -1024,12 +1012,8 @@ void wm8958_dsp2_init(struct snd_soc_codec *codec) ...@@ -1024,12 +1012,8 @@ void wm8958_dsp2_init(struct snd_soc_codec *codec)
/* We need an array of texts for the enum API */ /* We need an array of texts for the enum API */
wm8994->enh_eq_texts = kmalloc(sizeof(char *) wm8994->enh_eq_texts = kmalloc(sizeof(char *)
* pdata->num_enh_eq_cfgs, GFP_KERNEL); * pdata->num_enh_eq_cfgs, GFP_KERNEL);
if (!wm8994->enh_eq_texts) { if (!wm8994->enh_eq_texts)
dev_err(wm8994->hubs.codec->dev,
"Failed to allocate %d enhanced EQ config texts\n",
pdata->num_enh_eq_cfgs);
return; return;
}
for (i = 0; i < pdata->num_enh_eq_cfgs; i++) for (i = 0; i < pdata->num_enh_eq_cfgs; i++)
wm8994->enh_eq_texts[i] = pdata->enh_eq_cfgs[i].name; wm8994->enh_eq_texts[i] = pdata->enh_eq_cfgs[i].name;
......
...@@ -3296,12 +3296,8 @@ static void wm8994_handle_pdata(struct wm8994_priv *wm8994) ...@@ -3296,12 +3296,8 @@ static void wm8994_handle_pdata(struct wm8994_priv *wm8994)
/* We need an array of texts for the enum API */ /* We need an array of texts for the enum API */
wm8994->drc_texts = devm_kzalloc(wm8994->hubs.codec->dev, wm8994->drc_texts = devm_kzalloc(wm8994->hubs.codec->dev,
sizeof(char *) * pdata->num_drc_cfgs, GFP_KERNEL); sizeof(char *) * pdata->num_drc_cfgs, GFP_KERNEL);
if (!wm8994->drc_texts) { if (!wm8994->drc_texts)
dev_err(wm8994->hubs.codec->dev,
"Failed to allocate %d DRC config texts\n",
pdata->num_drc_cfgs);
return; return;
}
for (i = 0; i < pdata->num_drc_cfgs; i++) for (i = 0; i < pdata->num_drc_cfgs; i++)
wm8994->drc_texts[i] = pdata->drc_cfgs[i].name; wm8994->drc_texts[i] = pdata->drc_cfgs[i].name;
......
...@@ -613,10 +613,8 @@ static int wm9090_i2c_probe(struct i2c_client *i2c, ...@@ -613,10 +613,8 @@ static int wm9090_i2c_probe(struct i2c_client *i2c,
int ret; int ret;
wm9090 = devm_kzalloc(&i2c->dev, sizeof(*wm9090), GFP_KERNEL); wm9090 = devm_kzalloc(&i2c->dev, sizeof(*wm9090), GFP_KERNEL);
if (wm9090 == NULL) { if (!wm9090)
dev_err(&i2c->dev, "Can not allocate memory\n");
return -ENOMEM; return -ENOMEM;
}
wm9090->regmap = devm_regmap_init_i2c(i2c, &wm9090_regmap); wm9090->regmap = devm_regmap_init_i2c(i2c, &wm9090_regmap);
if (IS_ERR(wm9090->regmap)) { if (IS_ERR(wm9090->regmap)) {
......
...@@ -183,10 +183,8 @@ static void wm_hubs_dcs_cache_set(struct snd_soc_codec *codec, u16 dcs_cfg) ...@@ -183,10 +183,8 @@ static void wm_hubs_dcs_cache_set(struct snd_soc_codec *codec, u16 dcs_cfg)
return; return;
cache = devm_kzalloc(codec->dev, sizeof(*cache), GFP_KERNEL); cache = devm_kzalloc(codec->dev, sizeof(*cache), GFP_KERNEL);
if (!cache) { if (!cache)
dev_err(codec->dev, "Failed to allocate DCS cache entry\n");
return; return;
}
cache->left = snd_soc_read(codec, WM8993_LEFT_OUTPUT_VOLUME); cache->left = snd_soc_read(codec, WM8993_LEFT_OUTPUT_VOLUME);
cache->left &= WM8993_HPOUT1L_VOL_MASK; cache->left &= WM8993_HPOUT1L_VOL_MASK;
......
...@@ -466,7 +466,7 @@ static int asoc_dmic_probe(struct platform_device *pdev) ...@@ -466,7 +466,7 @@ static int asoc_dmic_probe(struct platform_device *pdev)
mutex_init(&dmic->mutex); mutex_init(&dmic->mutex);
dmic->fclk = clk_get(dmic->dev, "fck"); dmic->fclk = devm_clk_get(dmic->dev, "fck");
if (IS_ERR(dmic->fclk)) { if (IS_ERR(dmic->fclk)) {
dev_err(dmic->dev, "cant get fck\n"); dev_err(dmic->dev, "cant get fck\n");
return -ENODEV; return -ENODEV;
...@@ -475,8 +475,7 @@ static int asoc_dmic_probe(struct platform_device *pdev) ...@@ -475,8 +475,7 @@ static int asoc_dmic_probe(struct platform_device *pdev)
res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "dma"); res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "dma");
if (!res) { if (!res) {
dev_err(dmic->dev, "invalid dma memory resource\n"); dev_err(dmic->dev, "invalid dma memory resource\n");
ret = -ENODEV; return -ENODEV;
goto err_put_clk;
} }
dmic->dma_data.addr = res->start + OMAP_DMIC_DATA_REG; dmic->dma_data.addr = res->start + OMAP_DMIC_DATA_REG;
...@@ -484,34 +483,19 @@ static int asoc_dmic_probe(struct platform_device *pdev) ...@@ -484,34 +483,19 @@ static int asoc_dmic_probe(struct platform_device *pdev)
res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "mpu"); res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "mpu");
dmic->io_base = devm_ioremap_resource(&pdev->dev, res); dmic->io_base = devm_ioremap_resource(&pdev->dev, res);
if (IS_ERR(dmic->io_base)) { if (IS_ERR(dmic->io_base))
ret = PTR_ERR(dmic->io_base); return PTR_ERR(dmic->io_base);
goto err_put_clk;
}
ret = snd_soc_register_component(&pdev->dev, &omap_dmic_component, ret = devm_snd_soc_register_component(&pdev->dev,
&omap_dmic_component,
&omap_dmic_dai, 1); &omap_dmic_dai, 1);
if (ret) if (ret)
goto err_put_clk; return ret;
ret = omap_pcm_platform_register(&pdev->dev); ret = omap_pcm_platform_register(&pdev->dev);
if (ret) if (ret)
goto err_put_clk;
return 0;
err_put_clk:
clk_put(dmic->fclk);
return ret; return ret;
}
static int asoc_dmic_remove(struct platform_device *pdev)
{
struct omap_dmic *dmic = platform_get_drvdata(pdev);
snd_soc_unregister_component(&pdev->dev);
clk_put(dmic->fclk);
return 0; return 0;
} }
...@@ -529,7 +513,6 @@ static struct platform_driver asoc_dmic_driver = { ...@@ -529,7 +513,6 @@ static struct platform_driver asoc_dmic_driver = {
.of_match_table = omap_dmic_of_match, .of_match_table = omap_dmic_of_match,
}, },
.probe = asoc_dmic_probe, .probe = asoc_dmic_probe,
.remove = asoc_dmic_remove,
}; };
module_platform_driver(asoc_dmic_driver); module_platform_driver(asoc_dmic_driver);
......
...@@ -805,7 +805,8 @@ static int asoc_mcbsp_probe(struct platform_device *pdev) ...@@ -805,7 +805,8 @@ static int asoc_mcbsp_probe(struct platform_device *pdev)
if (ret) if (ret)
return ret; return ret;
ret = snd_soc_register_component(&pdev->dev, &omap_mcbsp_component, ret = devm_snd_soc_register_component(&pdev->dev,
&omap_mcbsp_component,
&omap_mcbsp_dai, 1); &omap_mcbsp_dai, 1);
if (ret) if (ret)
return ret; return ret;
...@@ -817,8 +818,6 @@ static int asoc_mcbsp_remove(struct platform_device *pdev) ...@@ -817,8 +818,6 @@ static int asoc_mcbsp_remove(struct platform_device *pdev)
{ {
struct omap_mcbsp *mcbsp = platform_get_drvdata(pdev); struct omap_mcbsp *mcbsp = platform_get_drvdata(pdev);
snd_soc_unregister_component(&pdev->dev);
if (mcbsp->pdata->ops && mcbsp->pdata->ops->free) if (mcbsp->pdata->ops && mcbsp->pdata->ops->free)
mcbsp->pdata->ops->free(mcbsp->id); mcbsp->pdata->ops->free(mcbsp->id);
......
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
#include <sound/pcm_params.h> #include <sound/pcm_params.h>
#include <sound/dmaengine_pcm.h> #include <sound/dmaengine_pcm.h>
#include <sound/soc.h> #include <sound/soc.h>
#include <sound/omap-pcm.h>
#ifdef CONFIG_ARCH_OMAP1 #ifdef CONFIG_ARCH_OMAP1
#define pcm_omap1510() cpu_is_omap1510() #define pcm_omap1510() cpu_is_omap1510()
......
...@@ -723,7 +723,8 @@ static int pxa_ssp_probe(struct snd_soc_dai *dai) ...@@ -723,7 +723,8 @@ static int pxa_ssp_probe(struct snd_soc_dai *dai)
ssp_handle = of_parse_phandle(dev->of_node, "port", 0); ssp_handle = of_parse_phandle(dev->of_node, "port", 0);
if (!ssp_handle) { if (!ssp_handle) {
dev_err(dev, "unable to get 'port' phandle\n"); dev_err(dev, "unable to get 'port' phandle\n");
return -ENODEV; ret = -ENODEV;
goto err_priv;
} }
priv->ssp = pxa_ssp_request_of(ssp_handle, "SoC audio"); priv->ssp = pxa_ssp_request_of(ssp_handle, "SoC audio");
......
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