From d2ccde1c8e90d38cee87a1b0309ad2827f3fd30d Mon Sep 17 00:00:00 2001 From: hc <hc@nodka.com> Date: Mon, 11 Dec 2023 02:45:28 +0000 Subject: [PATCH] add boot partition size --- kernel/drivers/macintosh/windfarm_smu_sat.c | 15 ++++++--------- 1 files changed, 6 insertions(+), 9 deletions(-) diff --git a/kernel/drivers/macintosh/windfarm_smu_sat.c b/kernel/drivers/macintosh/windfarm_smu_sat.c index 51ef77d..e46e115 100644 --- a/kernel/drivers/macintosh/windfarm_smu_sat.c +++ b/kernel/drivers/macintosh/windfarm_smu_sat.c @@ -1,9 +1,8 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * Windfarm PowerMac thermal control. SMU "satellite" controller sensors. * * Copyright (C) 2005 Paul Mackerras, IBM Corp. <paulus@samba.org> - * - * Released under the terms of the GNU GPL v2. */ #include <linux/types.h> @@ -197,7 +196,7 @@ struct wf_sat *sat; struct wf_sat_sensor *sens; const u32 *reg; - const char *loc, *type; + const char *loc; u8 chip, core; struct device_node *child; int shift, cpu, index; @@ -217,10 +216,8 @@ vsens[0] = vsens[1] = -1; isens[0] = isens[1] = -1; - child = NULL; - while ((child = of_get_next_child(dev, child)) != NULL) { + for_each_child_of_node(dev, child) { reg = of_get_property(child, "reg", NULL); - type = of_get_property(child, "device_type", NULL); loc = of_get_property(child, "location", NULL); if (reg == NULL || loc == NULL) continue; @@ -249,15 +246,15 @@ continue; } - if (strcmp(type, "voltage-sensor") == 0) { + if (of_node_is_type(child, "voltage-sensor")) { name = "cpu-voltage"; shift = 4; vsens[core] = index; - } else if (strcmp(type, "current-sensor") == 0) { + } else if (of_node_is_type(child, "current-sensor")) { name = "cpu-current"; shift = 8; isens[core] = index; - } else if (strcmp(type, "temp-sensor") == 0) { + } else if (of_node_is_type(child, "temp-sensor")) { name = "cpu-temp"; shift = 10; } else -- Gitblit v1.6.2