OSDN Git Service

mfd: ti_am335x_tscadc: Delete an error message for a failed memory allocation in...
authorMarkus Elfring <elfring@users.sourceforge.net>
Thu, 8 Mar 2018 14:15:51 +0000 (15:15 +0100)
committerLee Jones <lee.jones@linaro.org>
Wed, 16 May 2018 08:21:48 +0000 (09:21 +0100)
Omit an extra message for a memory allocation failure in this function.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
drivers/mfd/ti_am335x_tscadc.c

index 3cd958a..47012c0 100644 (file)
@@ -169,10 +169,9 @@ static     int ti_tscadc_probe(struct platform_device *pdev)
 
        /* Allocate memory for device */
        tscadc = devm_kzalloc(&pdev->dev, sizeof(*tscadc), GFP_KERNEL);
-       if (!tscadc) {
-               dev_err(&pdev->dev, "failed to allocate memory.\n");
+       if (!tscadc)
                return -ENOMEM;
-       }
+
        tscadc->dev = &pdev->dev;
 
        err = platform_get_irq(pdev, 0);