ASoC: Freescale: Delete an error message for a failed memory allocation in three...
authorMarkus Elfring <elfring@users.sourceforge.net>
Fri, 11 Aug 2017 13:10:43 +0000 (15:10 +0200)
committerMark Brown <broonie@kernel.org>
Tue, 15 Aug 2017 11:54:02 +0000 (12:54 +0100)
Omit an extra message for a memory allocation failure in these functions.

This issue was detected by using the Coccinelle software.

Link: http://events.linuxfoundation.org/sites/events/files/slides/LCJ16-Refactor_Strings-WSang_0.pdf
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/fsl/fsl_asrc_dma.c
sound/soc/fsl/fsl_dma.c
sound/soc/fsl/fsl_ssi.c

index 282d841840b1cfbea8d1ca97c3b764d21101d15c..2baf19608bd067a176baaa4a36450c50148184b9 100644 (file)
@@ -279,10 +279,8 @@ static int fsl_asrc_dma_startup(struct snd_pcm_substream *substream)
        struct fsl_asrc_pair *pair;
 
        pair = kzalloc(sizeof(struct fsl_asrc_pair), GFP_KERNEL);
-       if (!pair) {
-               dev_err(dev, "failed to allocate pair\n");
+       if (!pair)
                return -ENOMEM;
-       }
 
        pair->asrc_priv = asrc_priv;
 
index 979ed1b3ecc45c58ed9685bbf00391cd09156e19..c1735964891518e099702b916f0974ed8d1455d5 100644 (file)
@@ -905,7 +905,6 @@ static int fsl_soc_dma_probe(struct platform_device *pdev)
 
        dma = kzalloc(sizeof(*dma) + strlen(np->full_name), GFP_KERNEL);
        if (!dma) {
-               dev_err(&pdev->dev, "could not allocate dma object\n");
                of_node_put(ssi_np);
                return -ENOMEM;
        }
index 173cb8496641353b63177acba147278541c36370..64598d1183f8f14613a844333ff6c9c2da21f6bc 100644 (file)
@@ -1432,10 +1432,8 @@ static int fsl_ssi_probe(struct platform_device *pdev)
 
        ssi_private = devm_kzalloc(&pdev->dev, sizeof(*ssi_private),
                        GFP_KERNEL);
-       if (!ssi_private) {
-               dev_err(&pdev->dev, "could not allocate DAI object\n");
+       if (!ssi_private)
                return -ENOMEM;
-       }
 
        ssi_private->soc = of_id->data;
        ssi_private->dev = &pdev->dev;