leds: Remove duplicated OOM message for individual driver
authorXiubo Li <Li.Xiubo@freescale.com>
Thu, 8 May 2014 03:25:52 +0000 (20:25 -0700)
committerBryan Wu <cooloney@gmail.com>
Thu, 8 May 2014 06:28:08 +0000 (14:28 +0800)
The OOM message of individual driver is unnecessary, and this is
duplicate the memory subsystem generic OOM message.

Signed-off-by: Xiubo Li <Li.Xiubo@freescale.com>
Signed-off-by: Bryan Wu <cooloney@gmail.com>
drivers/leds/leds-adp5520.c
drivers/leds/leds-bd2802.c
drivers/leds/leds-da903x.c
drivers/leds/leds-da9052.c
drivers/leds/leds-s3c24xx.c
drivers/leds/leds-sunfire.c

index 86b5bdb0c77303665f7bc705e5bd43dca39e7df4..5036d7b4f82e812f60fce7322288339162077cb0 100644 (file)
@@ -120,13 +120,10 @@ static int adp5520_led_probe(struct platform_device *pdev)
 
        led = devm_kzalloc(&pdev->dev, sizeof(*led) * pdata->num_leds,
                                GFP_KERNEL);
-       if (led == NULL) {
-               dev_err(&pdev->dev, "failed to alloc memory\n");
+       if (!led)
                return -ENOMEM;
-       }
 
        ret = adp5520_led_prepare(pdev);
-
        if (ret) {
                dev_err(&pdev->dev, "failed to write\n");
                return ret;
index fb5a3472d61444c1cd8d491ee8a5ee571f39765c..6078c15d3452df77da066ec2f3d00bc805c02fa0 100644 (file)
@@ -678,10 +678,8 @@ static int bd2802_probe(struct i2c_client *client,
        int ret, i;
 
        led = devm_kzalloc(&client->dev, sizeof(struct bd2802_led), GFP_KERNEL);
-       if (!led) {
-               dev_err(&client->dev, "failed to allocate driver data\n");
+       if (!led)
                return -ENOMEM;
-       }
 
        led->client = client;
        pdata = led->pdata = dev_get_platdata(&client->dev);
index 35dffb100388c10e7568202c9fc73cd4c8738be5..54b8b5216b8b624210d63d05cd3ed5d12b22eb81 100644 (file)
@@ -108,10 +108,8 @@ static int da903x_led_probe(struct platform_device *pdev)
        }
 
        led = devm_kzalloc(&pdev->dev, sizeof(struct da903x_led), GFP_KERNEL);
-       if (led == NULL) {
-               dev_err(&pdev->dev, "failed to alloc memory for LED%d\n", id);
+       if (!led)
                return -ENOMEM;
-       }
 
        led->cdev.name = pdata->name;
        led->cdev.default_trigger = pdata->default_trigger;
index 01486adc7f8ba969502a3ee3e13004da439d6c01..e4da1f460ac58bddc8183314336e7031bb261623 100644 (file)
@@ -126,8 +126,7 @@ static int da9052_led_probe(struct platform_device *pdev)
        led = devm_kzalloc(&pdev->dev,
                           sizeof(struct da9052_led) * pled->num_leds,
                           GFP_KERNEL);
-       if (led == NULL) {
-               dev_err(&pdev->dev, "Failed to alloc memory\n");
+       if (!led) {
                error = -ENOMEM;
                goto err;
        }
index 28988b7b4faba371970027eb6459105bb3ea712d..785eb53a87fc1158d5b07e78002dd5b4ec356c9e 100644 (file)
@@ -76,10 +76,8 @@ static int s3c24xx_led_probe(struct platform_device *dev)
 
        led = devm_kzalloc(&dev->dev, sizeof(struct s3c24xx_gpio_led),
                           GFP_KERNEL);
-       if (led == NULL) {
-               dev_err(&dev->dev, "No memory for device\n");
+       if (!led)
                return -ENOMEM;
-       }
 
        platform_set_drvdata(dev, led);
 
index 388632d23d447130ca3a8368cd48bae9a9b410eb..0b8cc4a021a684b249dc28b1539c1f515516c1b7 100644 (file)
@@ -135,10 +135,8 @@ static int sunfire_led_generic_probe(struct platform_device *pdev,
        }
 
        p = devm_kzalloc(&pdev->dev, sizeof(*p), GFP_KERNEL);
-       if (!p) {
-               dev_err(&pdev->dev, "Could not allocate struct sunfire_drvdata\n");
+       if (!p)
                return -ENOMEM;
-       }
 
        for (i = 0; i < NUM_LEDS_PER_BOARD; i++) {
                struct led_classdev *lp = &p->leds[i].led_cdev;