16 #include <linux/module.h>
17 #include <linux/kernel.h>
23 #include <linux/slab.h>
41 static void adp5520_led_set(
struct led_classdev *led_cdev,
112 dev_err(&pdev->
dev,
"missing platform data\n");
117 dev_err(&pdev->
dev,
"can't handle more than %d LEDS\n",
125 dev_err(&pdev->
dev,
"failed to alloc memory\n");
129 ret = adp5520_led_prepare(pdev);
137 cur_led = &pdata->
leds[
i];
142 led_dat->
cdev.brightness_set = adp5520_led_set;
148 led_dat->
flags = i + 1;
159 dev_err(&pdev->
dev,
"failed to register LED %d\n",
164 ret = adp5520_led_setup(led_dat);
172 platform_set_drvdata(pdev, led);
177 for (i = i - 1; i >= 0; i--) {
192 led = platform_get_drvdata(pdev);
197 for (i = 0; i < pdata->
num_leds; i++) {
207 .name =
"adp5520-led",
210 .probe = adp5520_led_probe,