hc
2024-05-10 23fa18eaa71266feff7ba8d83022d9e1cc83c65a
kernel/drivers/leds/leds-mc13783.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * LEDs driver for Freescale MC13783/MC13892/MC34708
34 *
....@@ -9,10 +10,6 @@
910 *
1011 * Copyright (C) 2006-2008 Marvell International Ltd.
1112 * Eric Miao <eric.miao@marvell.com>
12
- *
13
- * This program is free software; you can redistribute it and/or modify
14
- * it under the terms of the GNU General Public License version 2 as
15
- * published by the Free Software Foundation.
1613 */
1714
1815 #include <linux/module.h>
....@@ -124,7 +121,7 @@
124121 if (!pdata)
125122 return ERR_PTR(-ENOMEM);
126123
127
- parent = of_get_child_by_name(dev->parent->of_node, "leds");
124
+ parent = of_get_child_by_name(dev_of_node(dev->parent), "leds");
128125 if (!parent)
129126 goto out_node_put;
130127
....@@ -134,7 +131,7 @@
134131 if (ret)
135132 goto out_node_put;
136133
137
- pdata->num_leds = of_get_child_count(parent);
134
+ pdata->num_leds = of_get_available_child_count(parent);
138135
139136 pdata->led = devm_kcalloc(dev, pdata->num_leds, sizeof(*pdata->led),
140137 GFP_KERNEL);
....@@ -143,7 +140,7 @@
143140 goto out_node_put;
144141 }
145142
146
- for_each_child_of_node(parent, child) {
143
+ for_each_available_child_of_node(parent, child) {
147144 const char *str;
148145 u32 tmp;
149146
....@@ -195,7 +192,7 @@
195192 leds->master = mcdev;
196193 platform_set_drvdata(pdev, leds);
197194
198
- if (dev->parent->of_node) {
195
+ if (dev_of_node(dev->parent)) {
199196 pdata = mc13xxx_led_probe_dt(pdev);
200197 if (IS_ERR(pdata))
201198 return PTR_ERR(pdata);