ASoC: DaVinci: Delete an error message for a failed memory allocation in two functions
authorMarkus Elfring <elfring@users.sourceforge.net>
Fri, 11 Aug 2017 14:51:46 +0000 (16:51 +0200)
committerMark Brown <broonie@kernel.org>
Mon, 14 Aug 2017 16:40:13 +0000 (17:40 +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/davinci/davinci-mcasp.c
sound/soc/davinci/davinci-vcif.c

index 56ec1d301ac2927b5ebabb123a28c2a56dbc532f..d486908d4e0e5ed0fa74838dc0df6f3e7933701d 100644 (file)
@@ -1602,8 +1602,6 @@ static struct davinci_mcasp_pdata *davinci_mcasp_set_pdata_from_of(
                pdata = devm_kmemdup(&pdev->dev, match->data, sizeof(*pdata),
                                     GFP_KERNEL);
                if (!pdata) {
-                       dev_err(&pdev->dev,
-                               "Failed to allocate memory for pdata\n");
                        ret = -ENOMEM;
                        return pdata;
                }
index c77d9218795adba25d2ae54665a8e21b769d6ee7..5415b72393fafac24fd685f0bed9c7740083975e 100644 (file)
@@ -210,11 +210,8 @@ static int davinci_vcif_probe(struct platform_device *pdev)
        davinci_vcif_dev = devm_kzalloc(&pdev->dev,
                                        sizeof(struct davinci_vcif_dev),
                                        GFP_KERNEL);
-       if (!davinci_vcif_dev) {
-               dev_dbg(&pdev->dev,
-                       "could not allocate memory for private data\n");
+       if (!davinci_vcif_dev)
                return -ENOMEM;
-       }
 
        /* DMA tx params */
        davinci_vcif_dev->davinci_vc = davinci_vc;