hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/drivers/hwmon/lm63.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * lm63.c - driver for the National Semiconductor LM63 temperature sensor
34 * with integrated fan control
....@@ -21,20 +22,6 @@
2122 * I had a explanation from National Semiconductor though. The two lower
2223 * bits of the read value have to be masked out. The value is still 16 bit
2324 * in width.
24
- *
25
- * This program is free software; you can redistribute it and/or modify
26
- * it under the terms of the GNU General Public License as published by
27
- * the Free Software Foundation; either version 2 of the License, or
28
- * (at your option) any later version.
29
- *
30
- * This program is distributed in the hope that it will be useful,
31
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
32
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
33
- * GNU General Public License for more details.
34
- *
35
- * You should have received a copy of the GNU General Public License
36
- * along with this program; if not, write to the Free Software
37
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
3825 */
3926
4027 #include <linux/module.h>
....@@ -1100,8 +1087,9 @@
11001087 (data->config_fan & 0x20) ? "manual" : "auto");
11011088 }
11021089
1103
-static int lm63_probe(struct i2c_client *client,
1104
- const struct i2c_device_id *id)
1090
+static const struct i2c_device_id lm63_id[];
1091
+
1092
+static int lm63_probe(struct i2c_client *client)
11051093 {
11061094 struct device *dev = &client->dev;
11071095 struct device *hwmon_dev;
....@@ -1119,8 +1107,7 @@
11191107 if (client->dev.of_node)
11201108 data->kind = (enum chips)of_device_get_match_data(&client->dev);
11211109 else
1122
- data->kind = id->driver_data;
1123
- data->kind = id->driver_data;
1110
+ data->kind = i2c_match_id(lm63_id, client)->driver_data;
11241111 if (data->kind == lm64)
11251112 data->temp2_offset = 16000;
11261113
....@@ -1154,7 +1141,7 @@
11541141 };
11551142 MODULE_DEVICE_TABLE(i2c, lm63_id);
11561143
1157
-static const struct of_device_id lm63_of_match[] = {
1144
+static const struct of_device_id __maybe_unused lm63_of_match[] = {
11581145 {
11591146 .compatible = "national,lm63",
11601147 .data = (void *)lm63
....@@ -1177,7 +1164,7 @@
11771164 .name = "lm63",
11781165 .of_match_table = of_match_ptr(lm63_of_match),
11791166 },
1180
- .probe = lm63_probe,
1167
+ .probe_new = lm63_probe,
11811168 .id_table = lm63_id,
11821169 .detect = lm63_detect,
11831170 .address_list = normal_i2c,