diff options
| -rw-r--r-- | drivers/leds/leds-adp5520.c | 5 | ||||
| -rw-r--r-- | drivers/leds/leds-bd2802.c | 4 | ||||
| -rw-r--r-- | drivers/leds/leds-da903x.c | 4 | ||||
| -rw-r--r-- | drivers/leds/leds-da9052.c | 3 | ||||
| -rw-r--r-- | drivers/leds/leds-s3c24xx.c | 4 | ||||
| -rw-r--r-- | drivers/leds/leds-sunfire.c | 4 |
6 files changed, 6 insertions, 18 deletions
diff --git a/drivers/leds/leds-adp5520.c b/drivers/leds/leds-adp5520.c index 86b5bdb0c773..5036d7b4f82e 100644 --- a/drivers/leds/leds-adp5520.c +++ b/drivers/leds/leds-adp5520.c | |||
| @@ -120,13 +120,10 @@ static int adp5520_led_probe(struct platform_device *pdev) | |||
| 120 | 120 | ||
| 121 | led = devm_kzalloc(&pdev->dev, sizeof(*led) * pdata->num_leds, | 121 | led = devm_kzalloc(&pdev->dev, sizeof(*led) * pdata->num_leds, |
| 122 | GFP_KERNEL); | 122 | GFP_KERNEL); |
| 123 | if (led == NULL) { | 123 | if (!led) |
| 124 | dev_err(&pdev->dev, "failed to alloc memory\n"); | ||
| 125 | return -ENOMEM; | 124 | return -ENOMEM; |
| 126 | } | ||
| 127 | 125 | ||
| 128 | ret = adp5520_led_prepare(pdev); | 126 | ret = adp5520_led_prepare(pdev); |
| 129 | |||
| 130 | if (ret) { | 127 | if (ret) { |
| 131 | dev_err(&pdev->dev, "failed to write\n"); | 128 | dev_err(&pdev->dev, "failed to write\n"); |
| 132 | return ret; | 129 | return ret; |
diff --git a/drivers/leds/leds-bd2802.c b/drivers/leds/leds-bd2802.c index fb5a3472d614..6078c15d3452 100644 --- a/drivers/leds/leds-bd2802.c +++ b/drivers/leds/leds-bd2802.c | |||
| @@ -678,10 +678,8 @@ static int bd2802_probe(struct i2c_client *client, | |||
| 678 | int ret, i; | 678 | int ret, i; |
| 679 | 679 | ||
| 680 | led = devm_kzalloc(&client->dev, sizeof(struct bd2802_led), GFP_KERNEL); | 680 | led = devm_kzalloc(&client->dev, sizeof(struct bd2802_led), GFP_KERNEL); |
| 681 | if (!led) { | 681 | if (!led) |
| 682 | dev_err(&client->dev, "failed to allocate driver data\n"); | ||
| 683 | return -ENOMEM; | 682 | return -ENOMEM; |
| 684 | } | ||
| 685 | 683 | ||
| 686 | led->client = client; | 684 | led->client = client; |
| 687 | pdata = led->pdata = dev_get_platdata(&client->dev); | 685 | pdata = led->pdata = dev_get_platdata(&client->dev); |
diff --git a/drivers/leds/leds-da903x.c b/drivers/leds/leds-da903x.c index 35dffb100388..54b8b5216b8b 100644 --- a/drivers/leds/leds-da903x.c +++ b/drivers/leds/leds-da903x.c | |||
| @@ -108,10 +108,8 @@ static int da903x_led_probe(struct platform_device *pdev) | |||
| 108 | } | 108 | } |
| 109 | 109 | ||
| 110 | led = devm_kzalloc(&pdev->dev, sizeof(struct da903x_led), GFP_KERNEL); | 110 | led = devm_kzalloc(&pdev->dev, sizeof(struct da903x_led), GFP_KERNEL); |
| 111 | if (led == NULL) { | 111 | if (!led) |
| 112 | dev_err(&pdev->dev, "failed to alloc memory for LED%d\n", id); | ||
| 113 | return -ENOMEM; | 112 | return -ENOMEM; |
| 114 | } | ||
| 115 | 113 | ||
| 116 | led->cdev.name = pdata->name; | 114 | led->cdev.name = pdata->name; |
| 117 | led->cdev.default_trigger = pdata->default_trigger; | 115 | led->cdev.default_trigger = pdata->default_trigger; |
diff --git a/drivers/leds/leds-da9052.c b/drivers/leds/leds-da9052.c index 01486adc7f8b..e4da1f460ac5 100644 --- a/drivers/leds/leds-da9052.c +++ b/drivers/leds/leds-da9052.c | |||
| @@ -126,8 +126,7 @@ static int da9052_led_probe(struct platform_device *pdev) | |||
| 126 | led = devm_kzalloc(&pdev->dev, | 126 | led = devm_kzalloc(&pdev->dev, |
| 127 | sizeof(struct da9052_led) * pled->num_leds, | 127 | sizeof(struct da9052_led) * pled->num_leds, |
| 128 | GFP_KERNEL); | 128 | GFP_KERNEL); |
| 129 | if (led == NULL) { | 129 | if (!led) { |
| 130 | dev_err(&pdev->dev, "Failed to alloc memory\n"); | ||
| 131 | error = -ENOMEM; | 130 | error = -ENOMEM; |
| 132 | goto err; | 131 | goto err; |
| 133 | } | 132 | } |
diff --git a/drivers/leds/leds-s3c24xx.c b/drivers/leds/leds-s3c24xx.c index 28988b7b4fab..785eb53a87fc 100644 --- a/drivers/leds/leds-s3c24xx.c +++ b/drivers/leds/leds-s3c24xx.c | |||
| @@ -76,10 +76,8 @@ static int s3c24xx_led_probe(struct platform_device *dev) | |||
| 76 | 76 | ||
| 77 | led = devm_kzalloc(&dev->dev, sizeof(struct s3c24xx_gpio_led), | 77 | led = devm_kzalloc(&dev->dev, sizeof(struct s3c24xx_gpio_led), |
| 78 | GFP_KERNEL); | 78 | GFP_KERNEL); |
| 79 | if (led == NULL) { | 79 | if (!led) |
| 80 | dev_err(&dev->dev, "No memory for device\n"); | ||
| 81 | return -ENOMEM; | 80 | return -ENOMEM; |
| 82 | } | ||
| 83 | 81 | ||
| 84 | platform_set_drvdata(dev, led); | 82 | platform_set_drvdata(dev, led); |
| 85 | 83 | ||
diff --git a/drivers/leds/leds-sunfire.c b/drivers/leds/leds-sunfire.c index 388632d23d44..0b8cc4a021a6 100644 --- a/drivers/leds/leds-sunfire.c +++ b/drivers/leds/leds-sunfire.c | |||
| @@ -135,10 +135,8 @@ static int sunfire_led_generic_probe(struct platform_device *pdev, | |||
| 135 | } | 135 | } |
| 136 | 136 | ||
| 137 | p = devm_kzalloc(&pdev->dev, sizeof(*p), GFP_KERNEL); | 137 | p = devm_kzalloc(&pdev->dev, sizeof(*p), GFP_KERNEL); |
| 138 | if (!p) { | 138 | if (!p) |
| 139 | dev_err(&pdev->dev, "Could not allocate struct sunfire_drvdata\n"); | ||
| 140 | return -ENOMEM; | 139 | return -ENOMEM; |
| 141 | } | ||
| 142 | 140 | ||
| 143 | for (i = 0; i < NUM_LEDS_PER_BOARD; i++) { | 141 | for (i = 0; i < NUM_LEDS_PER_BOARD; i++) { |
| 144 | struct led_classdev *lp = &p->leds[i].led_cdev; | 142 | struct led_classdev *lp = &p->leds[i].led_cdev; |
