From 4091d3425a2e4947a2d353c33356b05418240ace Mon Sep 17 00:00:00 2001 From: Robert Jarzmik Date: Mon, 9 Jun 2014 21:59:12 +0200 Subject: ASoC: pxa2xx-ac97: prepare and unprepare the clocks Add the clock prepare and unprepare call to the driver initialization phase. This will remove a warning once the PXA architecture is migrated to the clock infrastructure. Signed-off-by: Robert Jarzmik Signed-off-by: Mark Brown --- sound/arm/pxa2xx-ac97-lib.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'sound') diff --git a/sound/arm/pxa2xx-ac97-lib.c b/sound/arm/pxa2xx-ac97-lib.c index 66de90ed30ca..39c3969ac1c7 100644 --- a/sound/arm/pxa2xx-ac97-lib.c +++ b/sound/arm/pxa2xx-ac97-lib.c @@ -152,9 +152,9 @@ static inline void pxa_ac97_cold_pxa27x(void) gsr_bits = 0; /* PXA27x Developers Manual section 13.5.2.2.1 */ - clk_enable(ac97conf_clk); + clk_prepare_enable(ac97conf_clk); udelay(5); - clk_disable(ac97conf_clk); + clk_disable_unprepare(ac97conf_clk); GCR = GCR_COLD_RST | GCR_WARM_RST; } #endif @@ -299,14 +299,14 @@ static irqreturn_t pxa2xx_ac97_irq(int irq, void *dev_id) int pxa2xx_ac97_hw_suspend(void) { GCR |= GCR_ACLINK_OFF; - clk_disable(ac97_clk); + clk_disable_unprepare(ac97_clk); return 0; } EXPORT_SYMBOL_GPL(pxa2xx_ac97_hw_suspend); int pxa2xx_ac97_hw_resume(void) { - clk_enable(ac97_clk); + clk_prepare_enable(ac97_clk); return 0; } EXPORT_SYMBOL_GPL(pxa2xx_ac97_hw_resume); @@ -368,7 +368,7 @@ int pxa2xx_ac97_hw_probe(struct platform_device *dev) goto err_clk; } - ret = clk_enable(ac97_clk); + ret = clk_prepare_enable(ac97_clk); if (ret) goto err_clk2; @@ -403,7 +403,7 @@ void pxa2xx_ac97_hw_remove(struct platform_device *dev) clk_put(ac97conf_clk); ac97conf_clk = NULL; } - clk_disable(ac97_clk); + clk_disable_unprepare(ac97_clk); clk_put(ac97_clk); ac97_clk = NULL; } -- cgit v1.2.3 From 76a77f47123945f6e5a4dd167e54768012ef9669 Mon Sep 17 00:00:00 2001 From: Lars-Peter Clausen Date: Thu, 19 Jun 2014 09:40:29 +0200 Subject: ASoC: omap-pcm: Include omap-pcm.h omap_pcm_platform_register() is declared in omap-pcm.h and defined in omap-pcm.c. To make sure that the function signature matches for both omap-pcm.c should include omap-pcm.h Fixes the following warning from sparse: sound/soc/omap/omap-pcm.c:235:5: warning: symbol 'omap_pcm_platform_register' was not declared. Should it be static? Signed-off-by: Lars-Peter Clausen Signed-off-by: Mark Brown --- sound/soc/omap/omap-pcm.c | 1 + 1 file changed, 1 insertion(+) (limited to 'sound') diff --git a/sound/soc/omap/omap-pcm.c b/sound/soc/omap/omap-pcm.c index 8d809f8509c8..f4b05bc23e4b 100644 --- a/sound/soc/omap/omap-pcm.c +++ b/sound/soc/omap/omap-pcm.c @@ -31,6 +31,7 @@ #include #include #include +#include #ifdef CONFIG_ARCH_OMAP1 #define pcm_omap1510() cpu_is_omap1510() -- cgit v1.2.3 From 0e0327f2ab722e9e1e55c225cb86e1b02336ec96 Mon Sep 17 00:00:00 2001 From: Sachin Kamat Date: Fri, 20 Jun 2014 15:28:57 +0530 Subject: ASoC: cs4270: Remove redundant OOM message Let memory subsystem handle the error logging. Signed-off-by: Sachin Kamat Acked-by: Paul Handrigan Signed-off-by: Mark Brown --- sound/soc/codecs/cs4270.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'sound') diff --git a/sound/soc/codecs/cs4270.c b/sound/soc/codecs/cs4270.c index 9947a9583679..e6d4ff9fd992 100644 --- a/sound/soc/codecs/cs4270.c +++ b/sound/soc/codecs/cs4270.c @@ -664,10 +664,8 @@ static int cs4270_i2c_probe(struct i2c_client *i2c_client, cs4270 = devm_kzalloc(&i2c_client->dev, sizeof(struct cs4270_private), GFP_KERNEL); - if (!cs4270) { - dev_err(&i2c_client->dev, "could not allocate codec\n"); + if (!cs4270) return -ENOMEM; - } /* get the power supply regulators */ for (i = 0; i < ARRAY_SIZE(supply_names); i++) -- cgit v1.2.3 From 10d95ad48b4bf49b9853466654654eec2d9df031 Mon Sep 17 00:00:00 2001 From: Sachin Kamat Date: Fri, 20 Jun 2014 15:28:58 +0530 Subject: ASoC: cs42l73: Remove redundant OOM message Let memory subsystem handle the error logging. Signed-off-by: Sachin Kamat Acked-by: Paul Handrigan Signed-off-by: Mark Brown --- sound/soc/codecs/cs42l73.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'sound') diff --git a/sound/soc/codecs/cs42l73.c b/sound/soc/codecs/cs42l73.c index ae3717992d56..e3b601624794 100644 --- a/sound/soc/codecs/cs42l73.c +++ b/sound/soc/codecs/cs42l73.c @@ -1408,10 +1408,8 @@ static int cs42l73_i2c_probe(struct i2c_client *i2c_client, cs42l73 = devm_kzalloc(&i2c_client->dev, sizeof(struct cs42l73_private), GFP_KERNEL); - if (!cs42l73) { - dev_err(&i2c_client->dev, "could not allocate codec\n"); + if (!cs42l73) return -ENOMEM; - } cs42l73->regmap = devm_regmap_init_i2c(i2c_client, &cs42l73_regmap); if (IS_ERR(cs42l73->regmap)) { -- cgit v1.2.3 From be81333415fa06440a6fc788053db3622caab194 Mon Sep 17 00:00:00 2001 From: Sachin Kamat Date: Fri, 20 Jun 2014 15:28:59 +0530 Subject: ASoC: sgtl5000: Remove redundant OOM message Let memory subsystem handle the error logging. Signed-off-by: Sachin Kamat Signed-off-by: Mark Brown --- sound/soc/codecs/sgtl5000.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'sound') diff --git a/sound/soc/codecs/sgtl5000.c b/sound/soc/codecs/sgtl5000.c index 3d39f0b5b4a8..249fadbdb42e 100644 --- a/sound/soc/codecs/sgtl5000.c +++ b/sound/soc/codecs/sgtl5000.c @@ -843,10 +843,8 @@ static int ldo_regulator_register(struct snd_soc_codec *codec, ldo = kzalloc(sizeof(struct ldo_regulator), GFP_KERNEL); - if (!ldo) { - dev_err(codec->dev, "failed to allocate ldo_regulator\n"); + if (!ldo) return -ENOMEM; - } ldo->desc.name = kstrdup(dev_name(codec->dev), GFP_KERNEL); if (!ldo->desc.name) { -- cgit v1.2.3 From 5c1573a342ad6452f2d7af284612baae5d532a0a Mon Sep 17 00:00:00 2001 From: Sachin Kamat Date: Fri, 20 Jun 2014 15:29:00 +0530 Subject: ASoC: sta529: Remove redundant OOM message Let memory subsystem handle the error logging. Signed-off-by: Sachin Kamat Signed-off-by: Mark Brown --- sound/soc/codecs/sta529.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'sound') diff --git a/sound/soc/codecs/sta529.c b/sound/soc/codecs/sta529.c index a40c4b0196a3..fcdf11026aff 100644 --- a/sound/soc/codecs/sta529.c +++ b/sound/soc/codecs/sta529.c @@ -380,10 +380,8 @@ static int sta529_i2c_probe(struct i2c_client *i2c, return -EINVAL; sta529 = devm_kzalloc(&i2c->dev, sizeof(struct sta529), GFP_KERNEL); - if (sta529 == NULL) { - dev_err(&i2c->dev, "Can not allocate memory\n"); + if (!sta529) return -ENOMEM; - } sta529->regmap = devm_regmap_init_i2c(i2c, &sta529_regmap); if (IS_ERR(sta529->regmap)) { -- cgit v1.2.3 From b1117f5294ed845aefa499d67ca4faf2493bdf99 Mon Sep 17 00:00:00 2001 From: Sachin Kamat Date: Fri, 20 Jun 2014 15:29:01 +0530 Subject: ASoC: tlv320aic3x: Remove redundant OOM message Let memory subsystem handle the error logging. Signed-off-by: Sachin Kamat Signed-off-by: Mark Brown --- sound/soc/codecs/tlv320aic3x.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'sound') diff --git a/sound/soc/codecs/tlv320aic3x.c b/sound/soc/codecs/tlv320aic3x.c index e12fafbb1e09..446303198ffd 100644 --- a/sound/soc/codecs/tlv320aic3x.c +++ b/sound/soc/codecs/tlv320aic3x.c @@ -1477,10 +1477,8 @@ static int aic3x_i2c_probe(struct i2c_client *i2c, u32 value; aic3x = devm_kzalloc(&i2c->dev, sizeof(struct aic3x_priv), GFP_KERNEL); - if (aic3x == NULL) { - dev_err(&i2c->dev, "failed to create private data\n"); + if (!aic3x) return -ENOMEM; - } aic3x->regmap = devm_regmap_init_i2c(i2c, &aic3x_regmap); if (IS_ERR(aic3x->regmap)) { @@ -1498,10 +1496,8 @@ static int aic3x_i2c_probe(struct i2c_client *i2c, } else if (np) { ai3x_setup = devm_kzalloc(&i2c->dev, sizeof(*ai3x_setup), GFP_KERNEL); - if (ai3x_setup == NULL) { - dev_err(&i2c->dev, "failed to create private data\n"); + if (!ai3x_setup) return -ENOMEM; - } ret = of_get_named_gpio(np, "gpio-reset", 0); if (ret >= 0) -- cgit v1.2.3 From 656e3435752a66810ee0f8bcb8e012e9e6f26a42 Mon Sep 17 00:00:00 2001 From: Sachin Kamat Date: Fri, 20 Jun 2014 15:29:02 +0530 Subject: ASoC: tpa6130a2: Remove redundant OOM message Let memory subsystem handle the error logging. Signed-off-by: Sachin Kamat Signed-off-by: Mark Brown --- sound/soc/codecs/tpa6130a2.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'sound') diff --git a/sound/soc/codecs/tpa6130a2.c b/sound/soc/codecs/tpa6130a2.c index 8fc5a647453b..6fac9e034c48 100644 --- a/sound/soc/codecs/tpa6130a2.c +++ b/sound/soc/codecs/tpa6130a2.c @@ -381,10 +381,8 @@ static int tpa6130a2_probe(struct i2c_client *client, dev = &client->dev; data = devm_kzalloc(&client->dev, sizeof(*data), GFP_KERNEL); - if (data == NULL) { - dev_err(dev, "Can not allocate memory\n"); + if (!data) return -ENOMEM; - } if (pdata) { data->power_gpio = pdata->power_gpio; -- cgit v1.2.3 From 04cc41a809fb13867073ff76acf23e7df5c5b23d Mon Sep 17 00:00:00 2001 From: Sachin Kamat Date: Fri, 20 Jun 2014 15:29:03 +0530 Subject: ASoC: twl4030: Remove redundant OOM message Let memory subsystem handle the error logging. Signed-off-by: Sachin Kamat Signed-off-by: Mark Brown --- sound/soc/codecs/twl4030.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'sound') diff --git a/sound/soc/codecs/twl4030.c b/sound/soc/codecs/twl4030.c index 69e12a311ba2..955df35c5ab6 100644 --- a/sound/soc/codecs/twl4030.c +++ b/sound/soc/codecs/twl4030.c @@ -2162,10 +2162,8 @@ static int twl4030_soc_probe(struct snd_soc_codec *codec) twl4030 = devm_kzalloc(codec->dev, sizeof(struct twl4030_priv), GFP_KERNEL); - if (twl4030 == NULL) { - dev_err(codec->dev, "Can not allocate memory\n"); + if (!twl4030) return -ENOMEM; - } snd_soc_codec_set_drvdata(codec, twl4030); /* Set the defaults, and power up the codec */ twl4030->sysclk = twl4030_audio_get_mclk() / 1000; -- cgit v1.2.3 From ac872d3d72773d1ac8824fa6c04430efc72e2a43 Mon Sep 17 00:00:00 2001 From: Sachin Kamat Date: Fri, 20 Jun 2014 15:29:04 +0530 Subject: ASoC: wl1273: Remove redundant OOM message Let memory subsystem handle the error logging. Signed-off-by: Sachin Kamat Signed-off-by: Mark Brown --- sound/soc/codecs/wl1273.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'sound') diff --git a/sound/soc/codecs/wl1273.c b/sound/soc/codecs/wl1273.c index 4ead0dc02b87..5d8ba779085b 100644 --- a/sound/soc/codecs/wl1273.c +++ b/sound/soc/codecs/wl1273.c @@ -461,10 +461,8 @@ static int wl1273_probe(struct snd_soc_codec *codec) } wl1273 = kzalloc(sizeof(struct wl1273_priv), GFP_KERNEL); - if (wl1273 == NULL) { - dev_err(codec->dev, "Cannot allocate memory.\n"); + if (!wl1273) return -ENOMEM; - } wl1273->mode = WL1273_MODE_BT; wl1273->core = *core; -- cgit v1.2.3 From 84cbc75f9a72d646701ec4fb4accdfdc5f6f3ea2 Mon Sep 17 00:00:00 2001 From: Sachin Kamat Date: Fri, 20 Jun 2014 15:29:05 +0530 Subject: ASoC: wm0010: Remove redundant OOM message Let memory subsystem handle the error logging. Signed-off-by: Sachin Kamat Acked-by: Charles Keepax Signed-off-by: Mark Brown --- sound/soc/codecs/wm0010.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) (limited to 'sound') diff --git a/sound/soc/codecs/wm0010.c b/sound/soc/codecs/wm0010.c index 71ce3159a62e..982467c1d56a 100644 --- a/sound/soc/codecs/wm0010.c +++ b/sound/soc/codecs/wm0010.c @@ -413,7 +413,6 @@ static int wm0010_firmware_load(const char *name, struct snd_soc_codec *codec) xfer = kzalloc(sizeof(*xfer), GFP_KERNEL); if (!xfer) { - dev_err(codec->dev, "Failed to allocate xfer\n"); ret = -ENOMEM; goto abort; } @@ -423,8 +422,6 @@ static int wm0010_firmware_load(const char *name, struct snd_soc_codec *codec) out = kzalloc(len, GFP_KERNEL | GFP_DMA); if (!out) { - dev_err(codec->dev, - "Failed to allocate RX buffer\n"); ret = -ENOMEM; goto abort1; } @@ -432,8 +429,6 @@ static int wm0010_firmware_load(const char *name, struct snd_soc_codec *codec) img = kzalloc(len, GFP_KERNEL | GFP_DMA); if (!img) { - dev_err(codec->dev, - "Failed to allocate image buffer\n"); ret = -ENOMEM; goto abort1; } @@ -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 */ img = kzalloc(fw->size, GFP_KERNEL | GFP_DMA); if (!img) { - dev_err(codec->dev, "Failed to allocate image buffer\n"); ret = -ENOMEM; goto abort2; } out = kzalloc(fw->size, GFP_KERNEL | GFP_DMA); if (!out) { - dev_err(codec->dev, "Failed to allocate output buffer\n"); ret = -ENOMEM; goto abort1; } @@ -679,11 +672,8 @@ static int wm0010_boot(struct snd_soc_codec *codec) } img_swap = kzalloc(len, GFP_KERNEL | GFP_DMA); - if (!img_swap) { - dev_err(codec->dev, - "Failed to allocate image buffer\n"); + if (!img_swap) goto abort; - } /* We need to re-order for 0010 */ byte_swap_64((u64 *)&pll_rec, img_swap, len); -- cgit v1.2.3 From 611d7a7ba8678dfc2f597e8be6a1a6e4f2bdb8a4 Mon Sep 17 00:00:00 2001 From: Sachin Kamat Date: Fri, 20 Jun 2014 15:29:06 +0530 Subject: ASoC: wm1250-ev1: Remove redundant OOM message Let memory subsystem handle the error logging. Signed-off-by: Sachin Kamat Acked-by: Charles Keepax Signed-off-by: Mark Brown --- sound/soc/codecs/wm1250-ev1.c | 1 - 1 file changed, 1 deletion(-) (limited to 'sound') diff --git a/sound/soc/codecs/wm1250-ev1.c b/sound/soc/codecs/wm1250-ev1.c index 6e6b93d4696e..8011f75fb6cb 100644 --- a/sound/soc/codecs/wm1250-ev1.c +++ b/sound/soc/codecs/wm1250-ev1.c @@ -164,7 +164,6 @@ static int wm1250_ev1_pdata(struct i2c_client *i2c) wm1250 = devm_kzalloc(&i2c->dev, sizeof(*wm1250), GFP_KERNEL); if (!wm1250) { - dev_err(&i2c->dev, "Unable to allocate private data\n"); ret = -ENOMEM; goto err; } -- cgit v1.2.3 From a0f62118b73483d0e3a980759b5df869e81d4477 Mon Sep 17 00:00:00 2001 From: Sachin Kamat Date: Fri, 20 Jun 2014 15:29:07 +0530 Subject: ASoC: wm2000: Remove redundant OOM message Let memory subsystem handle the error logging. Signed-off-by: Sachin Kamat Acked-by: Charles Keepax Signed-off-by: Mark Brown --- sound/soc/codecs/wm2000.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'sound') diff --git a/sound/soc/codecs/wm2000.c b/sound/soc/codecs/wm2000.c index a4c352cc3464..34ef65c52a7d 100644 --- a/sound/soc/codecs/wm2000.c +++ b/sound/soc/codecs/wm2000.c @@ -826,10 +826,8 @@ static int wm2000_i2c_probe(struct i2c_client *i2c, wm2000 = devm_kzalloc(&i2c->dev, sizeof(struct wm2000_priv), GFP_KERNEL); - if (wm2000 == NULL) { - dev_err(&i2c->dev, "Unable to allocate private data\n"); + if (!wm2000) return -ENOMEM; - } mutex_init(&wm2000->lock); -- cgit v1.2.3 From d931099bebdd057e77d47e5a990db6e769374bd5 Mon Sep 17 00:00:00 2001 From: Sachin Kamat Date: Fri, 20 Jun 2014 15:29:08 +0530 Subject: ASoC: wm8904: Remove redundant OOM message Let memory subsystem handle the error logging. Signed-off-by: Sachin Kamat Acked-by: Charles Keepax Signed-off-by: Mark Brown --- sound/soc/codecs/wm8904.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'sound') diff --git a/sound/soc/codecs/wm8904.c b/sound/soc/codecs/wm8904.c index f7c549949c54..e2792980ecf2 100644 --- a/sound/soc/codecs/wm8904.c +++ b/sound/soc/codecs/wm8904.c @@ -2013,12 +2013,8 @@ static void wm8904_handle_pdata(struct snd_soc_codec *codec) /* We need an array of texts for the enum API */ wm8904->drc_texts = kmalloc(sizeof(char *) * pdata->num_drc_cfgs, GFP_KERNEL); - if (!wm8904->drc_texts) { - dev_err(codec->dev, - "Failed to allocate %d DRC config texts\n", - pdata->num_drc_cfgs); + if (!wm8904->drc_texts) return; - } for (i = 0; i < pdata->num_drc_cfgs; i++) wm8904->drc_texts[i] = pdata->drc_cfgs[i].name; -- cgit v1.2.3 From 2cec4ff7f05e4f8721dc9c02d4ef4a8ad1ada7e8 Mon Sep 17 00:00:00 2001 From: Sachin Kamat Date: Fri, 20 Jun 2014 15:29:09 +0530 Subject: ASoC: wm8958: Remove redundant OOM message Let memory subsystem handle the error logging. Signed-off-by: Sachin Kamat Acked-by: Charles Keepax Signed-off-by: Mark Brown --- sound/soc/codecs/wm8958-dsp2.c | 24 ++++-------------------- 1 file changed, 4 insertions(+), 20 deletions(-) (limited to 'sound') diff --git a/sound/soc/codecs/wm8958-dsp2.c b/sound/soc/codecs/wm8958-dsp2.c index b2ebb104d879..0dada7f0105e 100644 --- a/sound/soc/codecs/wm8958-dsp2.c +++ b/sound/soc/codecs/wm8958-dsp2.c @@ -934,12 +934,8 @@ void wm8958_dsp2_init(struct snd_soc_codec *codec) /* We need an array of texts for the enum API */ wm8994->mbc_texts = kmalloc(sizeof(char *) * pdata->num_mbc_cfgs, GFP_KERNEL); - if (!wm8994->mbc_texts) { - dev_err(wm8994->hubs.codec->dev, - "Failed to allocate %d MBC config texts\n", - pdata->num_mbc_cfgs); + if (!wm8994->mbc_texts) return; - } for (i = 0; i < pdata->num_mbc_cfgs; i++) wm8994->mbc_texts[i] = pdata->mbc_cfgs[i].name; @@ -963,12 +959,8 @@ void wm8958_dsp2_init(struct snd_soc_codec *codec) /* We need an array of texts for the enum API */ wm8994->vss_texts = kmalloc(sizeof(char *) * pdata->num_vss_cfgs, GFP_KERNEL); - if (!wm8994->vss_texts) { - dev_err(wm8994->hubs.codec->dev, - "Failed to allocate %d VSS config texts\n", - pdata->num_vss_cfgs); + if (!wm8994->vss_texts) return; - } for (i = 0; i < pdata->num_vss_cfgs; i++) wm8994->vss_texts[i] = pdata->vss_cfgs[i].name; @@ -993,12 +985,8 @@ void wm8958_dsp2_init(struct snd_soc_codec *codec) /* We need an array of texts for the enum API */ wm8994->vss_hpf_texts = kmalloc(sizeof(char *) * pdata->num_vss_hpf_cfgs, GFP_KERNEL); - 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); + if (!wm8994->vss_hpf_texts) return; - } for (i = 0; i < pdata->num_vss_hpf_cfgs; i++) wm8994->vss_hpf_texts[i] = pdata->vss_hpf_cfgs[i].name; @@ -1024,12 +1012,8 @@ void wm8958_dsp2_init(struct snd_soc_codec *codec) /* We need an array of texts for the enum API */ wm8994->enh_eq_texts = kmalloc(sizeof(char *) * pdata->num_enh_eq_cfgs, GFP_KERNEL); - 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); + if (!wm8994->enh_eq_texts) return; - } for (i = 0; i < pdata->num_enh_eq_cfgs; i++) wm8994->enh_eq_texts[i] = pdata->enh_eq_cfgs[i].name; -- cgit v1.2.3 From 549f66e0286bb800e024d80582f9c95c6f4f5947 Mon Sep 17 00:00:00 2001 From: Sachin Kamat Date: Fri, 20 Jun 2014 15:29:10 +0530 Subject: ASoC: wm8994: Remove redundant OOM message Let memory subsystem handle the error logging. Signed-off-by: Sachin Kamat Acked-by: Charles Keepax Signed-off-by: Mark Brown --- sound/soc/codecs/wm8994.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'sound') diff --git a/sound/soc/codecs/wm8994.c b/sound/soc/codecs/wm8994.c index 247b39013fba..621c442160e1 100644 --- a/sound/soc/codecs/wm8994.c +++ b/sound/soc/codecs/wm8994.c @@ -3296,12 +3296,8 @@ static void wm8994_handle_pdata(struct wm8994_priv *wm8994) /* We need an array of texts for the enum API */ wm8994->drc_texts = devm_kzalloc(wm8994->hubs.codec->dev, sizeof(char *) * pdata->num_drc_cfgs, GFP_KERNEL); - if (!wm8994->drc_texts) { - dev_err(wm8994->hubs.codec->dev, - "Failed to allocate %d DRC config texts\n", - pdata->num_drc_cfgs); + if (!wm8994->drc_texts) return; - } for (i = 0; i < pdata->num_drc_cfgs; i++) wm8994->drc_texts[i] = pdata->drc_cfgs[i].name; -- cgit v1.2.3 From 0463585ce5186e617aa5a04fa9f3f27160810a21 Mon Sep 17 00:00:00 2001 From: Sachin Kamat Date: Fri, 20 Jun 2014 15:29:11 +0530 Subject: ASoC: wm9090: Remove redundant OOM message Let memory subsystem handle the error logging. Signed-off-by: Sachin Kamat Acked-by: Charles Keepax Signed-off-by: Mark Brown --- sound/soc/codecs/wm9090.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'sound') diff --git a/sound/soc/codecs/wm9090.c b/sound/soc/codecs/wm9090.c index 87934171f063..a13f0725611a 100644 --- a/sound/soc/codecs/wm9090.c +++ b/sound/soc/codecs/wm9090.c @@ -613,10 +613,8 @@ static int wm9090_i2c_probe(struct i2c_client *i2c, int ret; wm9090 = devm_kzalloc(&i2c->dev, sizeof(*wm9090), GFP_KERNEL); - if (wm9090 == NULL) { - dev_err(&i2c->dev, "Can not allocate memory\n"); + if (!wm9090) return -ENOMEM; - } wm9090->regmap = devm_regmap_init_i2c(i2c, &wm9090_regmap); if (IS_ERR(wm9090->regmap)) { -- cgit v1.2.3 From ba546687083b68f43c26fcce9771278faae2bcf5 Mon Sep 17 00:00:00 2001 From: Sachin Kamat Date: Fri, 20 Jun 2014 15:29:12 +0530 Subject: ASoC: wm_hubs: Remove redundant OOM message Let memory subsystem handle the error logging. Signed-off-by: Sachin Kamat Acked-by: Charles Keepax Signed-off-by: Mark Brown --- sound/soc/codecs/wm_hubs.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'sound') diff --git a/sound/soc/codecs/wm_hubs.c b/sound/soc/codecs/wm_hubs.c index 916817fe6632..374537d5e179 100644 --- a/sound/soc/codecs/wm_hubs.c +++ b/sound/soc/codecs/wm_hubs.c @@ -183,10 +183,8 @@ static void wm_hubs_dcs_cache_set(struct snd_soc_codec *codec, u16 dcs_cfg) return; cache = devm_kzalloc(codec->dev, sizeof(*cache), GFP_KERNEL); - if (!cache) { - dev_err(codec->dev, "Failed to allocate DCS cache entry\n"); + if (!cache) return; - } cache->left = snd_soc_read(codec, WM8993_LEFT_OUTPUT_VOLUME); cache->left &= WM8993_HPOUT1L_VOL_MASK; -- cgit v1.2.3 From 36765c9c0623e87ab5ac6cfc07f66072b83edfdc Mon Sep 17 00:00:00 2001 From: Manish Badarkhe Date: Tue, 8 Jul 2014 21:55:23 +0530 Subject: ASoC: omap-mcbsp: Use devm_snd_soc_register_component Replaced snd_soc_register_component with its devres equivalent, devm_snd_soc_register_component. Signed-off-by: Manish Badarkhe Acked-by: Peter Ujfalusi Signed-off-by: Mark Brown --- sound/soc/omap/omap-mcbsp.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'sound') diff --git a/sound/soc/omap/omap-mcbsp.c b/sound/soc/omap/omap-mcbsp.c index efe2cd699b77..bd3ef2a88be0 100644 --- a/sound/soc/omap/omap-mcbsp.c +++ b/sound/soc/omap/omap-mcbsp.c @@ -805,8 +805,9 @@ static int asoc_mcbsp_probe(struct platform_device *pdev) if (ret) return ret; - ret = snd_soc_register_component(&pdev->dev, &omap_mcbsp_component, - &omap_mcbsp_dai, 1); + ret = devm_snd_soc_register_component(&pdev->dev, + &omap_mcbsp_component, + &omap_mcbsp_dai, 1); if (ret) return ret; @@ -817,8 +818,6 @@ static int asoc_mcbsp_remove(struct platform_device *pdev) { struct omap_mcbsp *mcbsp = platform_get_drvdata(pdev); - snd_soc_unregister_component(&pdev->dev); - if (mcbsp->pdata->ops && mcbsp->pdata->ops->free) mcbsp->pdata->ops->free(mcbsp->id); -- cgit v1.2.3 From 159baadf59416d9ddf860bac9f39e19a04b21603 Mon Sep 17 00:00:00 2001 From: Manish Badarkhe Date: Tue, 8 Jul 2014 22:23:17 +0530 Subject: ASoC: omap-dmic: Use devm_snd_soc_register_component Replaced snd_soc_register_component with its devres equivalent, devm_snd_soc_register_component. Signed-off-by: Manish Badarkhe Acked-by: Peter Ujfalusi Signed-off-by: Mark Brown --- sound/soc/omap/omap-dmic.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'sound') diff --git a/sound/soc/omap/omap-dmic.c b/sound/soc/omap/omap-dmic.c index 6925d7141215..f125eb95d8c8 100644 --- a/sound/soc/omap/omap-dmic.c +++ b/sound/soc/omap/omap-dmic.c @@ -490,8 +490,9 @@ static int asoc_dmic_probe(struct platform_device *pdev) } - ret = snd_soc_register_component(&pdev->dev, &omap_dmic_component, - &omap_dmic_dai, 1); + ret = devm_snd_soc_register_component(&pdev->dev, + &omap_dmic_component, + &omap_dmic_dai, 1); if (ret) goto err_put_clk; @@ -510,7 +511,6 @@ 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; -- cgit v1.2.3 From 9cb0fe9b0ee178474245a0a402eb628a3fb9a64a Mon Sep 17 00:00:00 2001 From: Himangi Saraogi Date: Fri, 11 Jul 2014 09:44:06 +0530 Subject: ASoC: omap-dmic: Use devm_clk_get This patch introduces the use of managed interfaces like devm_clk_get and does away with the clk_puts in the probe and remove functions. A label is also done away with. Signed-off-by: Himangi Saraogi Acked-by: Peter Ujfalusi Signed-off-by: Mark Brown --- sound/soc/omap/omap-dmic.c | 29 ++++++----------------------- 1 file changed, 6 insertions(+), 23 deletions(-) (limited to 'sound') diff --git a/sound/soc/omap/omap-dmic.c b/sound/soc/omap/omap-dmic.c index f125eb95d8c8..0f34e28a3d55 100644 --- a/sound/soc/omap/omap-dmic.c +++ b/sound/soc/omap/omap-dmic.c @@ -466,7 +466,7 @@ static int asoc_dmic_probe(struct platform_device *pdev) mutex_init(&dmic->mutex); - dmic->fclk = clk_get(dmic->dev, "fck"); + dmic->fclk = devm_clk_get(dmic->dev, "fck"); if (IS_ERR(dmic->fclk)) { dev_err(dmic->dev, "cant get fck\n"); return -ENODEV; @@ -475,8 +475,7 @@ static int asoc_dmic_probe(struct platform_device *pdev) res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "dma"); if (!res) { dev_err(dmic->dev, "invalid dma memory resource\n"); - ret = -ENODEV; - goto err_put_clk; + return -ENODEV; } dmic->dma_data.addr = res->start + OMAP_DMIC_DATA_REG; @@ -484,34 +483,19 @@ static int asoc_dmic_probe(struct platform_device *pdev) res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "mpu"); dmic->io_base = devm_ioremap_resource(&pdev->dev, res); - if (IS_ERR(dmic->io_base)) { - ret = PTR_ERR(dmic->io_base); - goto err_put_clk; - } + if (IS_ERR(dmic->io_base)) + return PTR_ERR(dmic->io_base); ret = devm_snd_soc_register_component(&pdev->dev, &omap_dmic_component, &omap_dmic_dai, 1); if (ret) - goto err_put_clk; + return ret; ret = omap_pcm_platform_register(&pdev->dev); if (ret) - goto err_put_clk; - - return 0; - -err_put_clk: - clk_put(dmic->fclk); - return ret; -} - -static int asoc_dmic_remove(struct platform_device *pdev) -{ - struct omap_dmic *dmic = platform_get_drvdata(pdev); - - clk_put(dmic->fclk); + return ret; return 0; } @@ -529,7 +513,6 @@ static struct platform_driver asoc_dmic_driver = { .of_match_table = omap_dmic_of_match, }, .probe = asoc_dmic_probe, - .remove = asoc_dmic_remove, }; module_platform_driver(asoc_dmic_driver); -- cgit v1.2.3 From 4548728981de259d7d37d0ae968a777b09794168 Mon Sep 17 00:00:00 2001 From: Dan Carpenter Date: Thu, 31 Jul 2014 15:57:51 +0300 Subject: ASoC: pxa: pxa-ssp: small leak in probe() There is a small memory leak if probe() fails. Fixes: 2023c90c3a2c ('ASoC: pxa: pxa-ssp: add DT bindings') Signed-off-by: Dan Carpenter Signed-off-by: Mark Brown --- sound/soc/pxa/pxa-ssp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'sound') diff --git a/sound/soc/pxa/pxa-ssp.c b/sound/soc/pxa/pxa-ssp.c index 199a8b377553..0109f6c2334e 100644 --- a/sound/soc/pxa/pxa-ssp.c +++ b/sound/soc/pxa/pxa-ssp.c @@ -723,7 +723,8 @@ static int pxa_ssp_probe(struct snd_soc_dai *dai) ssp_handle = of_parse_phandle(dev->of_node, "port", 0); if (!ssp_handle) { 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"); -- cgit v1.2.3