hc
2023-12-11 d2ccde1c8e90d38cee87a1b0309ad2827f3fd30d
kernel/drivers/hwmon/w83773g.c
....@@ -1,10 +1,6 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * Copyright (C) 2017 IBM Corp.
3
- *
4
- * This program is free software; you can redistribute it and/or modify
5
- * it under the terms of the GNU General Public License as published by
6
- * the Free Software Foundation; either version 2 of the License, or
7
- * (at your option) any later version.
84 *
95 * Driver for the Nuvoton W83773G SMBus temperature sensor IC.
106 * Supported models: W83773G
....@@ -44,7 +40,7 @@
4440
4541 MODULE_DEVICE_TABLE(i2c, w83773_id);
4642
47
-static const struct of_device_id w83773_of_match[] = {
43
+static const struct of_device_id __maybe_unused w83773_of_match[] = {
4844 {
4945 .compatible = "nuvoton,w83773g"
5046 },
....@@ -237,31 +233,13 @@
237233 return 0;
238234 }
239235
240
-static const u32 w83773_chip_config[] = {
241
- HWMON_C_REGISTER_TZ | HWMON_C_UPDATE_INTERVAL,
242
- 0
243
-};
244
-
245
-static const struct hwmon_channel_info w83773_chip = {
246
- .type = hwmon_chip,
247
- .config = w83773_chip_config,
248
-};
249
-
250
-static const u32 w83773_temp_config[] = {
251
- HWMON_T_INPUT,
252
- HWMON_T_INPUT | HWMON_T_FAULT | HWMON_T_OFFSET,
253
- HWMON_T_INPUT | HWMON_T_FAULT | HWMON_T_OFFSET,
254
- 0
255
-};
256
-
257
-static const struct hwmon_channel_info w83773_temp = {
258
- .type = hwmon_temp,
259
- .config = w83773_temp_config,
260
-};
261
-
262236 static const struct hwmon_channel_info *w83773_info[] = {
263
- &w83773_chip,
264
- &w83773_temp,
237
+ HWMON_CHANNEL_INFO(chip,
238
+ HWMON_C_REGISTER_TZ | HWMON_C_UPDATE_INTERVAL),
239
+ HWMON_CHANNEL_INFO(temp,
240
+ HWMON_T_INPUT,
241
+ HWMON_T_INPUT | HWMON_T_FAULT | HWMON_T_OFFSET,
242
+ HWMON_T_INPUT | HWMON_T_FAULT | HWMON_T_OFFSET),
265243 NULL
266244 };
267245
....@@ -281,8 +259,7 @@
281259 .val_bits = 8,
282260 };
283261
284
-static int w83773_probe(struct i2c_client *client,
285
- const struct i2c_device_id *id)
262
+static int w83773_probe(struct i2c_client *client)
286263 {
287264 struct device *dev = &client->dev;
288265 struct device *hwmon_dev;
....@@ -318,7 +295,7 @@
318295 .name = "w83773g",
319296 .of_match_table = of_match_ptr(w83773_of_match),
320297 },
321
- .probe = w83773_probe,
298
+ .probe_new = w83773_probe,
322299 .id_table = w83773_id,
323300 };
324301