hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/drivers/hwmon/max6621.c
....@@ -1,18 +1,9 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * Hardware monitoring driver for Maxim MAX6621
34 *
45 * Copyright (c) 2017 Mellanox Technologies. All rights reserved.
56 * Copyright (c) 2017 Vadim Pasternak <vadimp@mellanox.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 as published by
9
- * the Free Software Foundation; either version 2 of the License, or
10
- * (at your option) any later version.
11
- *
12
- * This program is distributed in the hope that it will be useful,
13
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
- * GNU General Public License for more details.
167 */
178
189 #include <linux/bitops.h>
....@@ -458,37 +449,19 @@
458449 .num_reg_defaults = ARRAY_SIZE(max6621_regmap_default),
459450 };
460451
461
-static u32 max6621_chip_config[] = {
462
- HWMON_C_REGISTER_TZ,
463
- 0
464
-};
465
-
466
-static const struct hwmon_channel_info max6621_chip = {
467
- .type = hwmon_chip,
468
- .config = max6621_chip_config,
469
-};
470
-
471
-static const u32 max6621_temp_config[] = {
472
- HWMON_T_INPUT | HWMON_T_LABEL | HWMON_T_OFFSET,
473
- HWMON_T_INPUT | HWMON_T_CRIT | HWMON_T_CRIT_ALARM | HWMON_T_LABEL,
474
- HWMON_T_INPUT | HWMON_T_CRIT | HWMON_T_CRIT_ALARM | HWMON_T_LABEL,
475
- HWMON_T_INPUT | HWMON_T_CRIT | HWMON_T_CRIT_ALARM | HWMON_T_LABEL,
476
- HWMON_T_INPUT | HWMON_T_CRIT | HWMON_T_CRIT_ALARM | HWMON_T_LABEL,
477
- HWMON_T_INPUT | HWMON_T_LABEL,
478
- HWMON_T_INPUT | HWMON_T_LABEL,
479
- HWMON_T_INPUT | HWMON_T_LABEL,
480
- HWMON_T_INPUT | HWMON_T_LABEL,
481
- 0
482
-};
483
-
484
-static const struct hwmon_channel_info max6621_temp = {
485
- .type = hwmon_temp,
486
- .config = max6621_temp_config,
487
-};
488
-
489452 static const struct hwmon_channel_info *max6621_info[] = {
490
- &max6621_chip,
491
- &max6621_temp,
453
+ HWMON_CHANNEL_INFO(chip,
454
+ HWMON_C_REGISTER_TZ),
455
+ HWMON_CHANNEL_INFO(temp,
456
+ HWMON_T_INPUT | HWMON_T_LABEL | HWMON_T_OFFSET,
457
+ HWMON_T_INPUT | HWMON_T_CRIT | HWMON_T_CRIT_ALARM | HWMON_T_LABEL,
458
+ HWMON_T_INPUT | HWMON_T_CRIT | HWMON_T_CRIT_ALARM | HWMON_T_LABEL,
459
+ HWMON_T_INPUT | HWMON_T_CRIT | HWMON_T_CRIT_ALARM | HWMON_T_LABEL,
460
+ HWMON_T_INPUT | HWMON_T_CRIT | HWMON_T_CRIT_ALARM | HWMON_T_LABEL,
461
+ HWMON_T_INPUT | HWMON_T_LABEL,
462
+ HWMON_T_INPUT | HWMON_T_LABEL,
463
+ HWMON_T_INPUT | HWMON_T_LABEL,
464
+ HWMON_T_INPUT | HWMON_T_LABEL),
492465 NULL
493466 };
494467
....@@ -504,8 +477,7 @@
504477 .info = max6621_info,
505478 };
506479
507
-static int max6621_probe(struct i2c_client *client,
508
- const struct i2c_device_id *id)
480
+static int max6621_probe(struct i2c_client *client)
509481 {
510482 struct device *dev = &client->dev;
511483 struct max6621_data *data;
....@@ -570,7 +542,7 @@
570542 };
571543 MODULE_DEVICE_TABLE(i2c, max6621_id);
572544
573
-static const struct of_device_id max6621_of_match[] = {
545
+static const struct of_device_id __maybe_unused max6621_of_match[] = {
574546 { .compatible = "maxim,max6621" },
575547 { }
576548 };
....@@ -582,7 +554,7 @@
582554 .name = MAX6621_DRV_NAME,
583555 .of_match_table = of_match_ptr(max6621_of_match),
584556 },
585
- .probe = max6621_probe,
557
+ .probe_new = max6621_probe,
586558 .id_table = max6621_id,
587559 };
588560