From 6ffa84df2b26b1ba78f6a55b373b9513c93017d6 Mon Sep 17 00:00:00 2001 From: Fabian Frederick Date: Wed, 18 Mar 2015 17:48:57 +0100 Subject: ASoC: fsl: constify of_device_id array of_device_id is always used as const. (See driver.of_match_table and open firmware functions) Signed-off-by: Fabian Frederick Signed-off-by: Mark Brown --- sound/soc/fsl/mpc5200_psc_ac97.c | 2 +- sound/soc/fsl/mpc5200_psc_i2s.c | 2 +- sound/soc/fsl/pcm030-audio-fabric.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'sound/soc/fsl') diff --git a/sound/soc/fsl/mpc5200_psc_ac97.c b/sound/soc/fsl/mpc5200_psc_ac97.c index 08d2a8069b0a..0bab76051fd8 100644 --- a/sound/soc/fsl/mpc5200_psc_ac97.c +++ b/sound/soc/fsl/mpc5200_psc_ac97.c @@ -326,7 +326,7 @@ static int psc_ac97_of_remove(struct platform_device *op) } /* Match table for of_platform binding */ -static struct of_device_id psc_ac97_match[] = { +static const struct of_device_id psc_ac97_match[] = { { .compatible = "fsl,mpc5200-psc-ac97", }, { .compatible = "fsl,mpc5200b-psc-ac97", }, {} diff --git a/sound/soc/fsl/mpc5200_psc_i2s.c b/sound/soc/fsl/mpc5200_psc_i2s.c index 51fb0c00fe73..d8232943ccb6 100644 --- a/sound/soc/fsl/mpc5200_psc_i2s.c +++ b/sound/soc/fsl/mpc5200_psc_i2s.c @@ -217,7 +217,7 @@ static int psc_i2s_of_remove(struct platform_device *op) } /* Match table for of_platform binding */ -static struct of_device_id psc_i2s_match[] = { +static const struct of_device_id psc_i2s_match[] = { { .compatible = "fsl,mpc5200-psc-i2s", }, { .compatible = "fsl,mpc5200b-psc-i2s", }, {} diff --git a/sound/soc/fsl/pcm030-audio-fabric.c b/sound/soc/fsl/pcm030-audio-fabric.c index c44459d24c50..ec731223cab3 100644 --- a/sound/soc/fsl/pcm030-audio-fabric.c +++ b/sound/soc/fsl/pcm030-audio-fabric.c @@ -113,7 +113,7 @@ static int pcm030_fabric_remove(struct platform_device *op) return ret; } -static struct of_device_id pcm030_audio_match[] = { +static const struct of_device_id pcm030_audio_match[] = { { .compatible = "phytec,pcm030-audio-fabric", }, {} }; -- cgit v1.2.3 From 299e7e97cc33d2d8894250ae2a3101bfb5670141 Mon Sep 17 00:00:00 2001 From: Fabio Estevam Date: Thu, 9 Apr 2015 14:56:41 -0300 Subject: ASoC: fsl_ssi: Use devm_snd_soc_register_component() Using devm_snd_soc_register_component() can make the code shorter and cleaner. Signed-off-by: Fabio Estevam Acked-by: Nicolin Chen Signed-off-by: Mark Brown --- sound/soc/fsl/fsl_ssi.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'sound/soc/fsl') diff --git a/sound/soc/fsl/fsl_ssi.c b/sound/soc/fsl/fsl_ssi.c index 2595611e8a6d..4201bfe2e9b9 100644 --- a/sound/soc/fsl/fsl_ssi.c +++ b/sound/soc/fsl/fsl_ssi.c @@ -1390,8 +1390,8 @@ static int fsl_ssi_probe(struct platform_device *pdev) return ret; } - ret = snd_soc_register_component(&pdev->dev, &fsl_ssi_component, - &ssi_private->cpu_dai_drv, 1); + ret = devm_snd_soc_register_component(&pdev->dev, &fsl_ssi_component, + &ssi_private->cpu_dai_drv, 1); if (ret) { dev_err(&pdev->dev, "failed to register DAI: %d\n", ret); goto error_asoc_register; @@ -1404,13 +1404,13 @@ static int fsl_ssi_probe(struct platform_device *pdev) if (ret < 0) { dev_err(&pdev->dev, "could not claim irq %u\n", ssi_private->irq); - goto error_irq; + goto error_asoc_register; } } ret = fsl_ssi_debugfs_create(&ssi_private->dbg_stats, &pdev->dev); if (ret) - goto error_irq; + goto error_asoc_register; /* * If codec-handle property is missing from SSI node, we assume @@ -1451,9 +1451,6 @@ done: error_sound_card: fsl_ssi_debugfs_remove(&ssi_private->dbg_stats); -error_irq: - snd_soc_unregister_component(&pdev->dev); - error_asoc_register: if (ssi_private->soc->imx) fsl_ssi_imx_clean(pdev, ssi_private); @@ -1469,7 +1466,6 @@ static int fsl_ssi_remove(struct platform_device *pdev) if (ssi_private->pdev) platform_device_unregister(ssi_private->pdev); - snd_soc_unregister_component(&pdev->dev); if (ssi_private->soc->imx) fsl_ssi_imx_clean(pdev, ssi_private); -- cgit v1.2.3 From ca2641891d8f0503f166502d168690c1e7d38e49 Mon Sep 17 00:00:00 2001 From: Fabio Estevam Date: Fri, 10 Apr 2015 07:12:29 -0300 Subject: ASoC: fsl_ssi: Use devm_ioremap_resource() Using platform_get_resource() and devm_ioremap_resource() can make the code a bit simpler. Signed-off-by: Fabio Estevam Signed-off-by: Mark Brown --- sound/soc/fsl/fsl_ssi.c | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) (limited to 'sound/soc/fsl') diff --git a/sound/soc/fsl/fsl_ssi.c b/sound/soc/fsl/fsl_ssi.c index 4201bfe2e9b9..4f643c45068f 100644 --- a/sound/soc/fsl/fsl_ssi.c +++ b/sound/soc/fsl/fsl_ssi.c @@ -1285,7 +1285,7 @@ static int fsl_ssi_probe(struct platform_device *pdev) const struct of_device_id *of_id; const char *p, *sprop; const uint32_t *iprop; - struct resource res; + struct resource *res; void __iomem *iomem; char name[64]; @@ -1332,19 +1332,11 @@ static int fsl_ssi_probe(struct platform_device *pdev) } ssi_private->cpu_dai_drv.name = dev_name(&pdev->dev); - /* Get the addresses and IRQ */ - ret = of_address_to_resource(np, 0, &res); - if (ret) { - dev_err(&pdev->dev, "could not determine device resources\n"); - return ret; - } - ssi_private->ssi_phys = res.start; - - iomem = devm_ioremap(&pdev->dev, res.start, resource_size(&res)); - if (!iomem) { - dev_err(&pdev->dev, "could not map device resources\n"); - return -ENOMEM; - } + res = platform_get_resource(pdev, IORESOURCE_MEM, 0); + iomem = devm_ioremap_resource(&pdev->dev, res); + if (IS_ERR(iomem)) + return PTR_ERR(iomem); + ssi_private->ssi_phys = res->start; ret = of_property_match_string(np, "clock-names", "ipg"); if (ret < 0) { -- cgit v1.2.3 From 1169006b054ed98f6056b67fd7f18231b65794a0 Mon Sep 17 00:00:00 2001 From: Fabio Estevam Date: Thu, 9 Apr 2015 15:32:09 -0300 Subject: ASoC: fsl: Add the audio interface acronyms in Kconfig text To keep consistency with the other Kconfig entries, use the audio interface acronyms (SSI and SPDIF) in the Kconfig menu text. Signed-off-by: Fabio Estevam Acked-by: Nicolin Chen Signed-off-by: Mark Brown --- sound/soc/fsl/Kconfig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sound/soc/fsl') diff --git a/sound/soc/fsl/Kconfig b/sound/soc/fsl/Kconfig index 081e406b3713..19c302b0d763 100644 --- a/sound/soc/fsl/Kconfig +++ b/sound/soc/fsl/Kconfig @@ -24,7 +24,7 @@ config SND_SOC_FSL_SAI in-tree drivers select it automatically. config SND_SOC_FSL_SSI - tristate "Synchronous Serial Interface module support" + tristate "Synchronous Serial Interface module (SSI) support" select SND_SOC_IMX_PCM_DMA if SND_IMX_SOC != n select SND_SOC_IMX_PCM_FIQ if SND_IMX_SOC != n && (MXC_TZIC || MXC_AVIC) select REGMAP_MMIO @@ -35,7 +35,7 @@ config SND_SOC_FSL_SSI in-tree drivers select it automatically. config SND_SOC_FSL_SPDIF - tristate "Sony/Philips Digital Interface module support" + tristate "Sony/Philips Digital Interface (S/PDIF) module support" select REGMAP_MMIO select SND_SOC_IMX_PCM_DMA if SND_IMX_SOC != n select SND_SOC_IMX_PCM_FIQ if SND_IMX_SOC != n && (MXC_TZIC || MXC_AVIC) -- cgit v1.2.3