hc
2023-12-11 d2ccde1c8e90d38cee87a1b0309ad2827f3fd30d
kernel/drivers/sbus/char/envctrl.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /* envctrl.c: Temperature and Fan monitoring on Machines providing it.
23 *
34 * Copyright (C) 1998 Eddie C. Dost (ecd@skynet.be)
....@@ -35,8 +36,6 @@
3536
3637 #define DRIVER_NAME "envctrl"
3738 #define PFX DRIVER_NAME ": "
38
-
39
-#define ENVCTRL_MINOR 162
4039
4140 #define PCF8584_ADDRESS 0x55
4241
....@@ -714,9 +713,7 @@
714713 .owner = THIS_MODULE,
715714 .read = envctrl_read,
716715 .unlocked_ioctl = envctrl_ioctl,
717
-#ifdef CONFIG_COMPAT
718
- .compat_ioctl = envctrl_ioctl,
719
-#endif
716
+ .compat_ioctl = compat_ptr_ioctl,
720717 .open = envctrl_open,
721718 .release = envctrl_release,
722719 .llseek = noop_llseek,
....@@ -906,7 +903,7 @@
906903 int len;
907904
908905 root_node = of_find_node_by_path("/");
909
- if (!strcmp(root_node->name, "SUNW,UltraSPARC-IIi-cEngine")) {
906
+ if (of_node_name_eq(root_node, "SUNW,UltraSPARC-IIi-cEngine")) {
910907 for (len = 0; len < PCF8584_MAX_CHANNELS; ++len) {
911908 pchild->mon_type[len] = ENVCTRL_NOMON;
912909 }
....@@ -1039,10 +1036,10 @@
10391036 index = 0;
10401037 dp = op->dev.of_node->child;
10411038 while (dp) {
1042
- if (!strcmp(dp->name, "gpio")) {
1039
+ if (of_node_name_eq(dp, "gpio")) {
10431040 i2c_childlist[index].i2ctype = I2C_GPIO;
10441041 envctrl_init_i2c_child(dp, &(i2c_childlist[index++]));
1045
- } else if (!strcmp(dp->name, "adc")) {
1042
+ } else if (of_node_name_eq(dp, "adc")) {
10461043 i2c_childlist[index].i2ctype = I2C_ADC;
10471044 envctrl_init_i2c_child(dp, &(i2c_childlist[index++]));
10481045 }