Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

leds: lt3593: Make use of device properties

Device property API allows to gather device resources from different sources,
such as ACPI. Convert the driver to unleash the power of device property API.

Signed-off-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Pavel Machek <pavel@ucw.cz>

authored by

Andy Shevchenko and committed by
Pavel Machek
d33e98a1 f1e1d532

+3 -6
-1
drivers/leds/Kconfig
··· 617 617 tristate "LED driver for LT3593 controllers" 618 618 depends on LEDS_CLASS 619 619 depends on GPIOLIB || COMPILE_TEST 620 - depends on OF 621 620 help 622 621 This option enables support for LEDs driven by a Linear Technology 623 622 LT3593 controller. This controller uses a special one-wire pulse
+3 -5
drivers/leds/leds-lt3593.c
··· 7 7 #include <linux/delay.h> 8 8 #include <linux/gpio/consumer.h> 9 9 #include <linux/slab.h> 10 + #include <linux/mod_devicetable.h> 10 11 #include <linux/module.h> 11 - #include <linux/of.h> 12 + #include <linux/property.h> 12 13 13 14 #define LED_LT3593_NAME "lt3593" 14 15 ··· 69 68 struct led_init_data init_data = {}; 70 69 const char *tmp; 71 70 72 - if (!dev_of_node(dev)) 73 - return -ENODEV; 74 - 75 71 led_data = devm_kzalloc(dev, sizeof(*led_data), GFP_KERNEL); 76 72 if (!led_data) 77 73 return -ENOMEM; ··· 117 119 .probe = lt3593_led_probe, 118 120 .driver = { 119 121 .name = "leds-lt3593", 120 - .of_match_table = of_match_ptr(of_lt3593_leds_match), 122 + .of_match_table = of_lt3593_leds_match, 121 123 }, 122 124 }; 123 125