[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210510095045.3299382-26-andy.shevchenko@gmail.com>
Date: Mon, 10 May 2021 12:50:42 +0300
From: Andy Shevchenko <andy.shevchenko@...il.com>
To: Pavel Machek <pavel@....cz>,
Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
Amireddy Mallikarjuna reddy
<mallikarjunax.reddy@...ux.intel.com>,
Linus Walleij <linus.walleij@...aro.org>,
Marek BehĂșn <marek.behun@....cz>,
Abanoub Sameh <abanoubsameh8@...il.com>,
Dan Murphy <dmurphy@...com>,
Krzysztof Kozlowski <krzk@...nel.org>,
linux-leds@...r.kernel.org, linux-kernel@...r.kernel.org
Cc: Andy Shevchenko <andy.shevchenko@...il.com>
Subject: [PATCH v1 25/28] leds: lt3593: Make use of device properties
From: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
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@...il.com>
---
drivers/leds/Kconfig | 1 -
drivers/leds/leds-lt3593.c | 8 +++-----
2 files changed, 3 insertions(+), 6 deletions(-)
diff --git a/drivers/leds/Kconfig b/drivers/leds/Kconfig
index e3ee3c34d535..9ab706d5ded7 100644
--- a/drivers/leds/Kconfig
+++ b/drivers/leds/Kconfig
@@ -616,7 +616,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 7dab08773a34..d0160fde0f94 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;
@@ -118,7 +116,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,
},
};
--
2.31.1
Powered by blists - more mailing lists