From: Linus Torvalds Date: Sat, 15 Dec 2012 20:52:42 +0000 (-0800) Subject: Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/cooloney... X-Git-Tag: upstream/snapshot3+hdmi~6054 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e81d372ff9f694e13fa46e8b5aaed505c7fd2a1f;p=platform%2Fadaptation%2Frenesas_rcar%2Frenesas_kernel.git Merge branch 'for-next' of git://git./linux/kernel/git/cooloney/linux-leds Pull LED subsystem update from Bryan Wu. * 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/cooloney/linux-leds: (47 commits) leds: leds-lp5521: return an error code on error in probe() leds: leds-clevo-mail: Use pr_* instead of printks leds: leds-rb532: Fix checkpatch errors leds: led-triggers: Fix checkpatch warnings leds: ledtrig-backlight: Fix checkpatch error leds: leds-wrap: Use instead of leds: leds-wm8350: Use dev_err instead of printk leds: leds-pwm: Fix checkpatch warning leds: leds-pca955x: Use dev_info instead of printk leds: leds-net48xx: Use linux/io.h instead of asm/io.h leds: leds-lt3593: Fix checkpatch warnings leds: leds-gpio: Use dev_info instead of printk leds: leds-da903x: Fix checkpatch error and warnings leds: leds-bd2802: Fix checkpatch warnings leds: leds-adp5520: Fix checkpatch warnings leds: led-class: Fix checkpatch warning leds: leds-ns2: use devm_gpio_request_one leds: leds-lt3593: use devm_gpio_request_one leds: leds-gpio: use devm_gpio_request_one leds: lp3944: Fix return value ... --- e81d372ff9f694e13fa46e8b5aaed505c7fd2a1f diff --cc drivers/leds/leds-gpio.c index 291c207,4f31792..1885a26 --- a/drivers/leds/leds-gpio.c +++ b/drivers/leds/leds-gpio.c @@@ -224,9 -223,9 +223,9 @@@ static const struct of_device_id of_gpi {}, }; #else /* CONFIG_OF_GPIO */ -static struct gpio_leds_priv * __devinit gpio_leds_create_of(struct platform_device *pdev) +static struct gpio_leds_priv *gpio_leds_create_of(struct platform_device *pdev) { - return NULL; + return ERR_PTR(-ENODEV); } #endif /* CONFIG_OF_GPIO */ diff --cc drivers/leds/leds-lt3593.c index 34b3ba4,f415c20..c9b9e1f --- a/drivers/leds/leds-lt3593.c +++ b/drivers/leds/leds-lt3593.c @@@ -137,10 -130,9 +130,9 @@@ static void delete_lt3593_led(struct lt led_classdev_unregister(&led->cdev); cancel_work_sync(&led->work); - gpio_free(led->gpio); } -static int __devinit lt3593_led_probe(struct platform_device *pdev) +static int lt3593_led_probe(struct platform_device *pdev) { struct gpio_led_platform_data *pdata = pdev->dev.platform_data; struct lt3593_led_data *leds_data; diff --cc drivers/leds/leds-ns2.c index 7b75aff,9505d86..d978171 --- a/drivers/leds/leds-ns2.c +++ b/drivers/leds/leds-ns2.c @@@ -260,67 -247,9 +248,65 @@@ static void delete_ns2_led(struct ns2_l { device_remove_file(led_dat->cdev.dev, &dev_attr_sata); led_classdev_unregister(&led_dat->cdev); - gpio_free(led_dat->cmd); - gpio_free(led_dat->slow); } -static int __devinit ns2_led_probe(struct platform_device *pdev) +#ifdef CONFIG_OF_GPIO +/* + * Translate OpenFirmware node properties into platform_data. + */ +static int +ns2_leds_get_of_pdata(struct device *dev, struct ns2_led_platform_data *pdata) +{ + struct device_node *np = dev->of_node; + struct device_node *child; + struct ns2_led *leds; + int num_leds = 0; + int i = 0; + + num_leds = of_get_child_count(np); + if (!num_leds) + return -ENODEV; + + leds = devm_kzalloc(dev, num_leds * sizeof(struct ns2_led), + GFP_KERNEL); + if (!leds) + return -ENOMEM; + + for_each_child_of_node(np, child) { + const char *string; + int ret; + + ret = of_get_named_gpio(child, "cmd-gpio", 0); + if (ret < 0) + return ret; + leds[i].cmd = ret; + ret = of_get_named_gpio(child, "slow-gpio", 0); + if (ret < 0) + return ret; + leds[i].slow = ret; + ret = of_property_read_string(child, "label", &string); + leds[i].name = (ret == 0) ? string : child->name; + ret = of_property_read_string(child, "linux,default-trigger", + &string); + if (ret == 0) + leds[i].default_trigger = string; + + i++; + } + + pdata->leds = leds; + pdata->num_leds = num_leds; + + return 0; +} + +static const struct of_device_id of_ns2_leds_match[] = { + { .compatible = "lacie,ns2-leds", }, + {}, +}; +#endif /* CONFIG_OF_GPIO */ + +static int ns2_led_probe(struct platform_device *pdev) { struct ns2_led_platform_data *pdata = pdev->dev.platform_data; struct ns2_led_data *leds_data;