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-mc13783.c | 13 +++++-------- 1 files changed, 5 insertions(+), 8 deletions(-) diff --git a/kernel/drivers/leds/leds-mc13783.c b/kernel/drivers/leds/leds-mc13783.c index 47ad7de..675502c 100644 --- a/kernel/drivers/leds/leds-mc13783.c +++ b/kernel/drivers/leds/leds-mc13783.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * LEDs driver for Freescale MC13783/MC13892/MC34708 * @@ -9,10 +10,6 @@ * * Copyright (C) 2006-2008 Marvell International Ltd. * Eric Miao <eric.miao@marvell.com> - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. */ #include <linux/module.h> @@ -124,7 +121,7 @@ if (!pdata) return ERR_PTR(-ENOMEM); - parent = of_get_child_by_name(dev->parent->of_node, "leds"); + parent = of_get_child_by_name(dev_of_node(dev->parent), "leds"); if (!parent) goto out_node_put; @@ -134,7 +131,7 @@ if (ret) goto out_node_put; - pdata->num_leds = of_get_child_count(parent); + pdata->num_leds = of_get_available_child_count(parent); pdata->led = devm_kcalloc(dev, pdata->num_leds, sizeof(*pdata->led), GFP_KERNEL); @@ -143,7 +140,7 @@ goto out_node_put; } - for_each_child_of_node(parent, child) { + for_each_available_child_of_node(parent, child) { const char *str; u32 tmp; @@ -195,7 +192,7 @@ leds->master = mcdev; platform_set_drvdata(pdev, leds); - if (dev->parent->of_node) { + if (dev_of_node(dev->parent)) { pdata = mc13xxx_led_probe_dt(pdev); if (IS_ERR(pdata)) return PTR_ERR(pdata); -- Gitblit v1.6.2