From cfe267da9de756d15eab095358b0b122c57816a6 Mon Sep 17 00:00:00 2001 From: Gustavo A. R. Silva Date: Fri, 30 Jun 2017 17:26:48 -0500 Subject: ASoC: twl6040: fix error return code in twl6040_probe() platform_get_irq() returns an error code, but the twl6040 driver ignores it and always returns -EINVAL. This is not correct, and prevents -EPROBE_DEFER from being propagated properly. Notice that platform_get_irq() no longer returns 0 on error. Print and propagate the return value of platform_get_irq on failure. Signed-off-by: Gustavo A. R. Silva Signed-off-by: Mark Brown --- sound/soc/codecs/twl6040.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sound') diff --git a/sound/soc/codecs/twl6040.c b/sound/soc/codecs/twl6040.c index 2b6ad09e0886..96cf94a2b7a0 100644 --- a/sound/soc/codecs/twl6040.c +++ b/sound/soc/codecs/twl6040.c @@ -1123,8 +1123,8 @@ static int twl6040_probe(struct snd_soc_codec *codec) priv->plug_irq = platform_get_irq(pdev, 0); if (priv->plug_irq < 0) { - dev_err(codec->dev, "invalid irq\n"); - return -EINVAL; + dev_err(codec->dev, "invalid irq: %d\n", priv->plug_irq); + return priv->plug_irq; } INIT_DELAYED_WORK(&priv->hs_jack.work, twl6040_accessory_work); -- cgit v1.2.3 From 19b4b7292615358b9599ff9410a3e564b4844e90 Mon Sep 17 00:00:00 2001 From: Axel Lin Date: Wed, 2 Aug 2017 17:55:13 +0800 Subject: ASoC: wm8523: Fix array size for bclk_ratios ARRAY_SIZE(bclk_ratios) returns 7 for current code, then it cannot catch the error if "no matching BCLK/fs ratio". Fix it. Signed-off-by: Axel Lin Signed-off-by: Mark Brown --- sound/soc/codecs/wm8523.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sound') diff --git a/sound/soc/codecs/wm8523.c b/sound/soc/codecs/wm8523.c index 6d0a2723bfde..b1e4ce72e533 100644 --- a/sound/soc/codecs/wm8523.c +++ b/sound/soc/codecs/wm8523.c @@ -116,7 +116,7 @@ static struct { static struct { int value; int ratio; -} bclk_ratios[WM8523_NUM_RATES] = { +} bclk_ratios[] = { { 2, 32 }, { 3, 64 }, { 4, 128 }, -- cgit v1.2.3 From c0d088f04f115409287003b5fc0dfd3184d7d306 Mon Sep 17 00:00:00 2001 From: Axel Lin Date: Wed, 2 Aug 2017 17:55:14 +0800 Subject: ASoC: wm8523: Constfiy lrclk_ratios and bclk_ratios Signed-off-by: Axel Lin Signed-off-by: Mark Brown --- sound/soc/codecs/wm8523.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sound') diff --git a/sound/soc/codecs/wm8523.c b/sound/soc/codecs/wm8523.c index b1e4ce72e533..c7c33e98fbcb 100644 --- a/sound/soc/codecs/wm8523.c +++ b/sound/soc/codecs/wm8523.c @@ -100,7 +100,7 @@ static const struct snd_soc_dapm_route wm8523_dapm_routes[] = { { "LINEVOUTR", NULL, "DAC" }, }; -static struct { +static const struct { int value; int ratio; } lrclk_ratios[WM8523_NUM_RATES] = { @@ -113,7 +113,7 @@ static struct { { 7, 1152 }, }; -static struct { +static const struct { int value; int ratio; } bclk_ratios[] = { -- cgit v1.2.3 From 42271d951c1f9a6a3ae0392d245256d973b2fc58 Mon Sep 17 00:00:00 2001 From: Bhumika Goyal Date: Mon, 14 Aug 2017 17:08:49 +0530 Subject: ASoC: txx9: make snd_soc_platform_driver const Make this const as it is only passed as the 2nd argument to the function devm_snd_soc_register_platform, which is of type const. Done using Coccinelle. Signed-off-by: Bhumika Goyal Signed-off-by: Mark Brown --- sound/soc/txx9/txx9aclc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sound') diff --git a/sound/soc/txx9/txx9aclc.c b/sound/soc/txx9/txx9aclc.c index 7912bf09dc4d..7df95dfa8557 100644 --- a/sound/soc/txx9/txx9aclc.c +++ b/sound/soc/txx9/txx9aclc.c @@ -403,7 +403,7 @@ static int txx9aclc_pcm_remove(struct snd_soc_platform *platform) return 0; } -static struct snd_soc_platform_driver txx9aclc_soc_platform = { +static const struct snd_soc_platform_driver txx9aclc_soc_platform = { .probe = txx9aclc_pcm_probe, .remove = txx9aclc_pcm_remove, .ops = &txx9aclc_pcm_ops, -- cgit v1.2.3 From 5144468efb076b1859477de19257dd7ec9c24ed3 Mon Sep 17 00:00:00 2001 From: Arvind Yadav Date: Mon, 14 Aug 2017 11:26:33 +0530 Subject: ASoC: txx9: constify snd_pcm_ops structures snd_pcm_ops are not supposed to change at runtime. All functions working with snd_pcm_ops provided by work with const snd_pcm_ops. So mark the non-const structs as const. Signed-off-by: Arvind Yadav Signed-off-by: Mark Brown --- sound/soc/txx9/txx9aclc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sound') diff --git a/sound/soc/txx9/txx9aclc.c b/sound/soc/txx9/txx9aclc.c index 7df95dfa8557..a2bb68fea5a3 100644 --- a/sound/soc/txx9/txx9aclc.c +++ b/sound/soc/txx9/txx9aclc.c @@ -271,7 +271,7 @@ static int txx9aclc_pcm_close(struct snd_pcm_substream *substream) return 0; } -static struct snd_pcm_ops txx9aclc_pcm_ops = { +static const struct snd_pcm_ops txx9aclc_pcm_ops = { .open = txx9aclc_pcm_open, .close = txx9aclc_pcm_close, .ioctl = snd_pcm_lib_ioctl, -- cgit v1.2.3 From c9f3d3441311792a0beb410af74e1aad4c3f715d Mon Sep 17 00:00:00 2001 From: Bhumika Goyal Date: Mon, 14 Aug 2017 17:08:50 +0530 Subject: ASoC: soc-utils: make snd_soc_platform_driver const Make this const as it is only passed as the 2nd argument to the function snd_soc_register_platform, which is of type const. Done using Coccinelle Signed-off-by: Bhumika Goyal Signed-off-by: Mark Brown --- sound/soc/soc-utils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sound') diff --git a/sound/soc/soc-utils.c b/sound/soc/soc-utils.c index 644d9a9ebfbc..e30aacbcfc29 100644 --- a/sound/soc/soc-utils.c +++ b/sound/soc/soc-utils.c @@ -284,7 +284,7 @@ static const struct snd_pcm_ops dummy_dma_ops = { .ioctl = snd_pcm_lib_ioctl, }; -static struct snd_soc_platform_driver dummy_platform = { +static const struct snd_soc_platform_driver dummy_platform = { .ops = &dummy_dma_ops, }; -- cgit v1.2.3 From ab566fd52309971da595af057fd480aed82ca0e2 Mon Sep 17 00:00:00 2001 From: Arvind Yadav Date: Fri, 18 Aug 2017 17:36:10 +0530 Subject: ASoC: ux500: constify snd_soc_dai_ops structures snd_soc_dai_ops are not supposed to change at runtime. All functions working with snd_soc_dai_ops provided by work with const snd_soc_dai_ops. So mark the non-const structs as const. Signed-off-by: Arvind Yadav Signed-off-by: Mark Brown --- sound/soc/ux500/ux500_msp_dai.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sound') diff --git a/sound/soc/ux500/ux500_msp_dai.c b/sound/soc/ux500/ux500_msp_dai.c index ec5152aa3f6e..625b72a5facd 100644 --- a/sound/soc/ux500/ux500_msp_dai.c +++ b/sound/soc/ux500/ux500_msp_dai.c @@ -707,7 +707,7 @@ static int ux500_msp_dai_probe(struct snd_soc_dai *dai) return 0; } -static struct snd_soc_dai_ops ux500_msp_dai_ops[] = { +static const struct snd_soc_dai_ops ux500_msp_dai_ops[] = { { .set_sysclk = ux500_msp_dai_set_dai_sysclk, .set_fmt = ux500_msp_dai_set_dai_fmt, -- cgit v1.2.3 From c996b52df44b83d227d7664d2838ed1c6739c850 Mon Sep 17 00:00:00 2001 From: Donglin Peng Date: Sun, 20 Aug 2017 14:01:10 +0800 Subject: ASoC: ux500: Remove unnecessary function call First of all,the address of pdev->dev is assigned to mop500_card.dev, then the function platform_set_drvdata copies the value the variable card to pdev->dev.driver_data,but when calling snd_soc_register_card, the function dev_set_drvdata(card->dev, card) will also do the same copy operation,so i think that the former copy operation can be removed. Signed-off-by: Peng Donglin Signed-off-by: Mark Brown --- sound/soc/ux500/mop500.c | 1 - 1 file changed, 1 deletion(-) (limited to 'sound') diff --git a/sound/soc/ux500/mop500.c b/sound/soc/ux500/mop500.c index b50f68a439ce..9298580e4c2a 100644 --- a/sound/soc/ux500/mop500.c +++ b/sound/soc/ux500/mop500.c @@ -111,7 +111,6 @@ static int mop500_probe(struct platform_device *pdev) dev_dbg(&pdev->dev, "%s: Card %s: Set platform drvdata.\n", __func__, mop500_card.name); - platform_set_drvdata(pdev, &mop500_card); snd_soc_card_set_drvdata(&mop500_card, NULL); -- cgit v1.2.3