leds: powernv: Delete an error message for a failed memory allocation in powernv_led_...
authorMarkus Elfring <elfring@users.sourceforge.net>
Sun, 27 Aug 2017 20:00:22 +0000 (22:00 +0200)
committerJacek Anaszewski <jacek.anaszewski@gmail.com>
Tue, 29 Aug 2017 19:10:39 +0000 (21:10 +0200)
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>
Acked-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Jacek Anaszewski <jacek.anaszewski@gmail.com>
drivers/leds/leds-powernv.c

index b2a98c7b521b2208dc0234a2b0803601b6d03fc8..b1adbd70ce2e7b848bedd5148d7740238674ef21 100644 (file)
@@ -224,12 +224,8 @@ static int powernv_led_create(struct device *dev,
        powernv_led->cdev.name = devm_kasprintf(dev, GFP_KERNEL, "%s:%s",
                                                powernv_led->loc_code,
                                                led_type_desc);
-       if (!powernv_led->cdev.name) {
-               dev_err(dev,
-                       "%s: Memory allocation failed for classdev name\n",
-                       __func__);
+       if (!powernv_led->cdev.name)
                return -ENOMEM;
-       }
 
        powernv_led->cdev.brightness_set_blocking = powernv_brightness_set;
        powernv_led->cdev.brightness_get = powernv_brightness_get;