ARM: SAMSUNG: Remove printk for failed memory allocation
authorMarkus Elfring <elfring@users.sourceforge.net>
Wed, 4 Oct 2017 07:33:52 +0000 (09:33 +0200)
committerJunghoon Kim <jhoon20.kim@samsung.com>
Thu, 14 Feb 2019 05:55:43 +0000 (14:55 +0900)
Omit an extra message for a memory allocation failure in adc.c and
platformdata.c.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
arch/arm/plat-samsung/adc.c
arch/arm/plat-samsung/platformdata.c

index daf3db9..f8d6206 100644 (file)
@@ -239,10 +239,8 @@ struct s3c_adc_client *s3c_adc_register(struct platform_device *pdev,
                return ERR_PTR(-EINVAL);
 
        client = kzalloc(sizeof(struct s3c_adc_client), GFP_KERNEL);
-       if (!client) {
-               dev_err(&pdev->dev, "no memory for adc client\n");
+       if (!client)
                return ERR_PTR(-ENOMEM);
-       }
 
        client->pdev = pdev;
        client->is_ts = is_ts;
@@ -345,10 +343,8 @@ static int s3c_adc_probe(struct platform_device *pdev)
        unsigned tmp;
 
        adc = devm_kzalloc(dev, sizeof(struct adc_device), GFP_KERNEL);
-       if (adc == NULL) {
-               dev_err(dev, "failed to allocate adc_device\n");
+       if (!adc)
                return -ENOMEM;
-       }
 
        spin_lock_init(&adc->lock);
 
index b430e99..6cf52ee 100644 (file)
@@ -29,10 +29,8 @@ void __init *s3c_set_platdata(void *pd, size_t pdsize,
        }
 
        npd = kmemdup(pd, pdsize, GFP_KERNEL);
-       if (!npd) {
-               printk(KERN_ERR "%s: cannot clone platform data\n", pdev->name);
+       if (!npd)
                return NULL;
-       }
 
        pdev->dev.platform_data = npd;
        return npd;