]> git.baikalelectronics.ru Git - kernel.git/commitdiff
ASoC: fsl-asoc-card: force cast the asrc_format type
authorShengjiu Wang <shengjiu.wang@nxp.com>
Thu, 21 Jul 2022 10:29:51 +0000 (18:29 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 17 Aug 2022 12:24:10 +0000 (14:24 +0200)
[ Upstream commit 376611d3525c805b9f3ebd7f9b76c8fd419af843 ]

Fix sparse warning:
sound/soc/fsl/fsl-asoc-card.c:833:45: sparse: warning: incorrect type in argument 3 (different base types)
sound/soc/fsl/fsl-asoc-card.c:833:45: sparse:    expected unsigned int [usertype] *out_value
sound/soc/fsl/fsl-asoc-card.c:833:45: sparse:    got restricted snd_pcm_format_t *

Fixes: e89f900d2f14 ("ASoC: fsl-asoc-card: Support new property fsl, asrc-format")
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Link: https://lore.kernel.org/r/1658399393-28777-4-git-send-email-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
sound/soc/fsl/fsl-asoc-card.c

index 95286c839b57f26ef899770b9172482648e7b4f3..c72a156737e6120b26670f6da464f1df223dbf3d 100644 (file)
@@ -540,6 +540,7 @@ static int fsl_asoc_card_probe(struct platform_device *pdev)
        struct device *codec_dev = NULL;
        const char *codec_dai_name;
        const char *codec_dev_name;
+       u32 asrc_fmt = 0;
        u32 width;
        int ret;
 
@@ -817,8 +818,8 @@ static int fsl_asoc_card_probe(struct platform_device *pdev)
                        goto asrc_fail;
                }
 
-               ret = of_property_read_u32(asrc_np, "fsl,asrc-format",
-                                          &priv->asrc_format);
+               ret = of_property_read_u32(asrc_np, "fsl,asrc-format", &asrc_fmt);
+               priv->asrc_format = (__force snd_pcm_format_t)asrc_fmt;
                if (ret) {
                        /* Fallback to old binding; translate to asrc_format */
                        ret = of_property_read_u32(asrc_np, "fsl,asrc-width",