summaryrefslogtreecommitdiff
path: root/drivers/leds
diff options
context:
space:
mode:
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>2021-05-10 12:50:42 +0300
committerPavel Machek <pavel@ucw.cz>2021-05-28 12:00:16 +0200
commitd33e98a1f3ee76f38668304f9ffce49af07da77a (patch)
tree098756e0e4858e623abf871fc452072e500e8609 /drivers/leds
parentf1e1d532da7e6ef355528a22fb97d9a8fbf76c4e (diff)
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>
Diffstat (limited to 'drivers/leds')
-rw-r--r--drivers/leds/Kconfig1
-rw-r--r--drivers/leds/leds-lt3593.c8
2 files changed, 3 insertions, 6 deletions
diff --git a/drivers/leds/Kconfig b/drivers/leds/Kconfig
index c81b1e60953c..bdf16180f5ff 100644
--- a/drivers/leds/Kconfig
+++ b/drivers/leds/Kconfig
@@ -617,7 +617,6 @@ config LEDS_LT3593
tristate "LED driver for LT3593 controllers"
depends on LEDS_CLASS
depends on GPIOLIB || COMPILE_TEST
- depends on OF
help
This option enables support for LEDs driven by a Linear Technology
LT3593 controller. This controller uses a special one-wire pulse
diff --git a/drivers/leds/leds-lt3593.c b/drivers/leds/leds-lt3593.c
index 68e06434ac08..3bb52d3165d9 100644
--- a/drivers/leds/leds-lt3593.c
+++ b/drivers/leds/leds-lt3593.c
@@ -7,8 +7,9 @@
#include <linux/delay.h>
#include <linux/gpio/consumer.h>
#include <linux/slab.h>
+#include <linux/mod_devicetable.h>
#include <linux/module.h>
-#include <linux/of.h>
+#include <linux/property.h>
#define LED_LT3593_NAME "lt3593"
@@ -68,9 +69,6 @@ static int lt3593_led_probe(struct platform_device *pdev)
struct led_init_data init_data = {};
const char *tmp;
- if (!dev_of_node(dev))
- return -ENODEV;
-
led_data = devm_kzalloc(dev, sizeof(*led_data), GFP_KERNEL);
if (!led_data)
return -ENOMEM;
@@ -119,7 +117,7 @@ static struct platform_driver lt3593_led_driver = {
.probe = lt3593_led_probe,
.driver = {
.name = "leds-lt3593",
- .of_match_table = of_match_ptr(of_lt3593_leds_match),
+ .of_match_table = of_lt3593_leds_match,
},
};