Loading drivers/leds/leds-gpio.c +5 −6 Original line number Diff line number Diff line Loading @@ -178,7 +178,8 @@ static struct gpio_leds_priv * __devinit gpio_leds_create_of(struct platform_dev if (!count) return NULL; priv = kzalloc(sizeof_gpio_leds_priv(count), GFP_KERNEL); priv = devm_kzalloc(&pdev->dev, sizeof_gpio_leds_priv(count), GFP_KERNEL); if (!priv) return NULL; Loading Loading @@ -215,7 +216,6 @@ static struct gpio_leds_priv * __devinit gpio_leds_create_of(struct platform_dev err: for (count = priv->num_leds - 2; count >= 0; count--) delete_gpio_led(&priv->leds[count]); kfree(priv); return NULL; } Loading @@ -239,7 +239,8 @@ static int __devinit gpio_led_probe(struct platform_device *pdev) int i, ret = 0; if (pdata && pdata->num_leds) { priv = kzalloc(sizeof_gpio_leds_priv(pdata->num_leds), priv = devm_kzalloc(&pdev->dev, sizeof_gpio_leds_priv(pdata->num_leds), GFP_KERNEL); if (!priv) return -ENOMEM; Loading @@ -253,7 +254,6 @@ static int __devinit gpio_led_probe(struct platform_device *pdev) /* On failure: unwind the led creations */ for (i = i - 1; i >= 0; i--) delete_gpio_led(&priv->leds[i]); kfree(priv); return ret; } } Loading @@ -277,7 +277,6 @@ static int __devexit gpio_led_remove(struct platform_device *pdev) delete_gpio_led(&priv->leds[i]); dev_set_drvdata(&pdev->dev, NULL); kfree(priv); return 0; } Loading Loading
drivers/leds/leds-gpio.c +5 −6 Original line number Diff line number Diff line Loading @@ -178,7 +178,8 @@ static struct gpio_leds_priv * __devinit gpio_leds_create_of(struct platform_dev if (!count) return NULL; priv = kzalloc(sizeof_gpio_leds_priv(count), GFP_KERNEL); priv = devm_kzalloc(&pdev->dev, sizeof_gpio_leds_priv(count), GFP_KERNEL); if (!priv) return NULL; Loading Loading @@ -215,7 +216,6 @@ static struct gpio_leds_priv * __devinit gpio_leds_create_of(struct platform_dev err: for (count = priv->num_leds - 2; count >= 0; count--) delete_gpio_led(&priv->leds[count]); kfree(priv); return NULL; } Loading @@ -239,7 +239,8 @@ static int __devinit gpio_led_probe(struct platform_device *pdev) int i, ret = 0; if (pdata && pdata->num_leds) { priv = kzalloc(sizeof_gpio_leds_priv(pdata->num_leds), priv = devm_kzalloc(&pdev->dev, sizeof_gpio_leds_priv(pdata->num_leds), GFP_KERNEL); if (!priv) return -ENOMEM; Loading @@ -253,7 +254,6 @@ static int __devinit gpio_led_probe(struct platform_device *pdev) /* On failure: unwind the led creations */ for (i = i - 1; i >= 0; i--) delete_gpio_led(&priv->leds[i]); kfree(priv); return ret; } } Loading @@ -277,7 +277,6 @@ static int __devexit gpio_led_remove(struct platform_device *pdev) delete_gpio_led(&priv->leds[i]); dev_set_drvdata(&pdev->dev, NULL); kfree(priv); return 0; } Loading