diff options
author | Markus Elfring <elfring@users.sourceforge.net> | 2017-08-27 22:00:22 +0200 |
---|---|---|
committer | Jacek Anaszewski <jacek.anaszewski@gmail.com> | 2017-08-29 21:10:39 +0200 |
commit | 30f21ef22b7b7e1156cc2a7f9e714c002938f056 (patch) | |
tree | 182444af0d319dec6575b0e2c85a4a18c08901ae /drivers/leds/leds-powernv.c | |
parent | leds: lp8501: make several arrays static const (diff) | |
download | linux-30f21ef22b7b7e1156cc2a7f9e714c002938f056.tar.xz linux-30f21ef22b7b7e1156cc2a7f9e714c002938f056.zip |
leds: powernv: Delete an error message for a failed memory allocation in powernv_led_create()
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>
Diffstat (limited to 'drivers/leds/leds-powernv.c')
-rw-r--r-- | drivers/leds/leds-powernv.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/drivers/leds/leds-powernv.c b/drivers/leds/leds-powernv.c index b2a98c7b521b..b1adbd70ce2e 100644 --- a/drivers/leds/leds-powernv.c +++ b/drivers/leds/leds-powernv.c @@ -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; |