Commit 0c9a03b6 authored by Xiubo Li's avatar Xiubo Li Committed by Bryan Wu

leds: Remove duplicated OOM message for individual driver

The OOM message of individual driver is unnecessary, and this is
duplicate the memory subsystem generic OOM message.
Signed-off-by: default avatarXiubo Li <Li.Xiubo@freescale.com>
Signed-off-by: default avatarBryan Wu <cooloney@gmail.com>
parent 24c9301f
...@@ -120,13 +120,10 @@ static int adp5520_led_probe(struct platform_device *pdev) ...@@ -120,13 +120,10 @@ static int adp5520_led_probe(struct platform_device *pdev)
led = devm_kzalloc(&pdev->dev, sizeof(*led) * pdata->num_leds, led = devm_kzalloc(&pdev->dev, sizeof(*led) * pdata->num_leds,
GFP_KERNEL); GFP_KERNEL);
if (led == NULL) { if (!led)
dev_err(&pdev->dev, "failed to alloc memory\n");
return -ENOMEM; return -ENOMEM;
}
ret = adp5520_led_prepare(pdev); ret = adp5520_led_prepare(pdev);
if (ret) { if (ret) {
dev_err(&pdev->dev, "failed to write\n"); dev_err(&pdev->dev, "failed to write\n");
return ret; return ret;
......
...@@ -678,10 +678,8 @@ static int bd2802_probe(struct i2c_client *client, ...@@ -678,10 +678,8 @@ static int bd2802_probe(struct i2c_client *client,
int ret, i; int ret, i;
led = devm_kzalloc(&client->dev, sizeof(struct bd2802_led), GFP_KERNEL); led = devm_kzalloc(&client->dev, sizeof(struct bd2802_led), GFP_KERNEL);
if (!led) { if (!led)
dev_err(&client->dev, "failed to allocate driver data\n");
return -ENOMEM; return -ENOMEM;
}
led->client = client; led->client = client;
pdata = led->pdata = dev_get_platdata(&client->dev); pdata = led->pdata = dev_get_platdata(&client->dev);
......
...@@ -108,10 +108,8 @@ static int da903x_led_probe(struct platform_device *pdev) ...@@ -108,10 +108,8 @@ static int da903x_led_probe(struct platform_device *pdev)
} }
led = devm_kzalloc(&pdev->dev, sizeof(struct da903x_led), GFP_KERNEL); led = devm_kzalloc(&pdev->dev, sizeof(struct da903x_led), GFP_KERNEL);
if (led == NULL) { if (!led)
dev_err(&pdev->dev, "failed to alloc memory for LED%d\n", id);
return -ENOMEM; return -ENOMEM;
}
led->cdev.name = pdata->name; led->cdev.name = pdata->name;
led->cdev.default_trigger = pdata->default_trigger; led->cdev.default_trigger = pdata->default_trigger;
......
...@@ -126,8 +126,7 @@ static int da9052_led_probe(struct platform_device *pdev) ...@@ -126,8 +126,7 @@ static int da9052_led_probe(struct platform_device *pdev)
led = devm_kzalloc(&pdev->dev, led = devm_kzalloc(&pdev->dev,
sizeof(struct da9052_led) * pled->num_leds, sizeof(struct da9052_led) * pled->num_leds,
GFP_KERNEL); GFP_KERNEL);
if (led == NULL) { if (!led) {
dev_err(&pdev->dev, "Failed to alloc memory\n");
error = -ENOMEM; error = -ENOMEM;
goto err; goto err;
} }
......
...@@ -76,10 +76,8 @@ static int s3c24xx_led_probe(struct platform_device *dev) ...@@ -76,10 +76,8 @@ static int s3c24xx_led_probe(struct platform_device *dev)
led = devm_kzalloc(&dev->dev, sizeof(struct s3c24xx_gpio_led), led = devm_kzalloc(&dev->dev, sizeof(struct s3c24xx_gpio_led),
GFP_KERNEL); GFP_KERNEL);
if (led == NULL) { if (!led)
dev_err(&dev->dev, "No memory for device\n");
return -ENOMEM; return -ENOMEM;
}
platform_set_drvdata(dev, led); platform_set_drvdata(dev, led);
......
...@@ -135,10 +135,8 @@ static int sunfire_led_generic_probe(struct platform_device *pdev, ...@@ -135,10 +135,8 @@ static int sunfire_led_generic_probe(struct platform_device *pdev,
} }
p = devm_kzalloc(&pdev->dev, sizeof(*p), GFP_KERNEL); p = devm_kzalloc(&pdev->dev, sizeof(*p), GFP_KERNEL);
if (!p) { if (!p)
dev_err(&pdev->dev, "Could not allocate struct sunfire_drvdata\n");
return -ENOMEM; return -ENOMEM;
}
for (i = 0; i < NUM_LEDS_PER_BOARD; i++) { for (i = 0; i < NUM_LEDS_PER_BOARD; i++) {
struct led_classdev *lp = &p->leds[i].led_cdev; struct led_classdev *lp = &p->leds[i].led_cdev;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment