hc
2024-10-22 8ac6c7a54ed1b98d142dce24b11c6de6a1e239a5
kernel/drivers/leds/leds-88pm860x.c
....@@ -1,13 +1,9 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * LED driver for Marvell 88PM860x
34 *
45 * Copyright (C) 2009 Marvell International Ltd.
56 * Haojian Zhuang <haojian.zhuang@marvell.com>
6
- *
7
- * This program is free software; you can redistribute it and/or modify
8
- * it under the terms of the GNU General Public License version 2 as
9
- * published by the Free Software Foundation.
10
- *
117 */
128
139 #include <linux/kernel.h>
....@@ -122,15 +118,15 @@
122118 struct device_node *nproot, *np;
123119 int iset = 0;
124120
125
- if (!pdev->dev.parent->of_node)
121
+ if (!dev_of_node(pdev->dev.parent))
126122 return -ENODEV;
127
- nproot = of_get_child_by_name(pdev->dev.parent->of_node, "leds");
123
+ nproot = of_get_child_by_name(dev_of_node(pdev->dev.parent), "leds");
128124 if (!nproot) {
129125 dev_err(&pdev->dev, "failed to find leds node\n");
130126 return -ENODEV;
131127 }
132
- for_each_child_of_node(nproot, np) {
133
- if (!of_node_cmp(np->name, data->name)) {
128
+ for_each_available_child_of_node(nproot, np) {
129
+ if (of_node_name_eq(np, data->name)) {
134130 of_property_read_u32(np, "marvell,88pm860x-iset",
135131 &iset);
136132 data->iset = PM8606_LED_CURRENT(iset);