From f70575805708cabdedea7498aaa3f710fde4d920 Mon Sep 17 00:00:00 2001 From: hc <hc@nodka.com> Date: Wed, 31 Jan 2024 03:29:01 +0000 Subject: [PATCH] add lvds1024*800 --- kernel/drivers/leds/leds-syscon.c | 29 +++++++---------------------- 1 files changed, 7 insertions(+), 22 deletions(-) diff --git a/kernel/drivers/leds/leds-syscon.c b/kernel/drivers/leds/leds-syscon.c index 3be40f7..7eddb8e 100644 --- a/kernel/drivers/leds/leds-syscon.c +++ b/kernel/drivers/leds/leds-syscon.c @@ -1,23 +1,9 @@ +// SPDX-License-Identifier: GPL-2.0-or-later /* * Generic Syscon LEDs Driver * * Copyright (c) 2014, Linaro Limited * Author: Linus Walleij <linus.walleij@linaro.org> - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, - * MA 02111-1307 USA */ #include <linux/io.h> #include <linux/init.h> @@ -69,8 +55,9 @@ static int syscon_led_probe(struct platform_device *pdev) { + struct led_init_data init_data = {}; struct device *dev = &pdev->dev; - struct device_node *np = dev->of_node; + struct device_node *np = dev_of_node(dev); struct device *parent; struct regmap *map; struct syscon_led *sled; @@ -82,7 +69,7 @@ dev_err(dev, "no parent for syscon LED\n"); return -ENODEV; } - map = syscon_node_to_regmap(parent->of_node); + map = syscon_node_to_regmap(dev_of_node(parent)); if (IS_ERR(map)) { dev_err(dev, "no regmap for syscon LED parent\n"); return PTR_ERR(map); @@ -98,10 +85,6 @@ return -EINVAL; if (of_property_read_u32(np, "mask", &sled->mask)) return -EINVAL; - sled->cdev.name = - of_get_property(np, "label", NULL) ? : np->name; - sled->cdev.default_trigger = - of_get_property(np, "linux,default-trigger", NULL); state = of_get_property(np, "default-state", NULL); if (state) { @@ -129,7 +112,9 @@ } sled->cdev.brightness_set = syscon_led_set; - ret = led_classdev_register(dev, &sled->cdev); + init_data.fwnode = of_fwnode_handle(np); + + ret = devm_led_classdev_register_ext(dev, &sled->cdev, &init_data); if (ret < 0) return ret; -- Gitblit v1.6.2