hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/drivers/hwmon/lm95241.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * Copyright (C) 2008, 2010 Davide Rizzo <elpa.rizzo@gmail.com>
34 *
....@@ -5,16 +6,6 @@
56 * It reports up to three temperatures (its own plus up to two external ones).
67 * Complete datasheet can be obtained from National's website at:
78 * http://www.national.com/ds.cgi/LM/LM95241.pdf
8
- *
9
- * This program is free software; you can redistribute it and/or modify
10
- * it under the terms of the GNU General Public License as published by
11
- * the Free Software Foundation; either version 2 of the License, or
12
- * (at your option) any later version.
13
- *
14
- * This program is distributed in the hope that it will be useful,
15
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
16
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
- * GNU General Public License for more details.
189 */
1910
2011 #include <linux/bitops.h>
....@@ -349,19 +340,19 @@
349340 case hwmon_chip:
350341 switch (attr) {
351342 case hwmon_chip_update_interval:
352
- return S_IRUGO | S_IWUSR;
343
+ return 0644;
353344 }
354345 break;
355346 case hwmon_temp:
356347 switch (attr) {
357348 case hwmon_temp_input:
358
- return S_IRUGO;
349
+ return 0444;
359350 case hwmon_temp_fault:
360
- return S_IRUGO;
351
+ return 0444;
361352 case hwmon_temp_min:
362353 case hwmon_temp_max:
363354 case hwmon_temp_type:
364
- return S_IRUGO | S_IWUSR;
355
+ return 0644;
365356 }
366357 break;
367358 default:
....@@ -418,33 +409,15 @@
418409 data->model);
419410 }
420411
421
-static const u32 lm95241_chip_config[] = {
422
- HWMON_C_UPDATE_INTERVAL,
423
- 0
424
-};
425
-
426
-static const struct hwmon_channel_info lm95241_chip = {
427
- .type = hwmon_chip,
428
- .config = lm95241_chip_config,
429
-};
430
-
431
-static const u32 lm95241_temp_config[] = {
432
- HWMON_T_INPUT,
433
- HWMON_T_INPUT | HWMON_T_MAX | HWMON_T_MIN | HWMON_T_TYPE |
434
- HWMON_T_FAULT,
435
- HWMON_T_INPUT | HWMON_T_MAX | HWMON_T_MIN | HWMON_T_TYPE |
436
- HWMON_T_FAULT,
437
- 0
438
-};
439
-
440
-static const struct hwmon_channel_info lm95241_temp = {
441
- .type = hwmon_temp,
442
- .config = lm95241_temp_config,
443
-};
444
-
445412 static const struct hwmon_channel_info *lm95241_info[] = {
446
- &lm95241_chip,
447
- &lm95241_temp,
413
+ HWMON_CHANNEL_INFO(chip,
414
+ HWMON_C_UPDATE_INTERVAL),
415
+ HWMON_CHANNEL_INFO(temp,
416
+ HWMON_T_INPUT,
417
+ HWMON_T_INPUT | HWMON_T_MAX | HWMON_T_MIN |
418
+ HWMON_T_TYPE | HWMON_T_FAULT,
419
+ HWMON_T_INPUT | HWMON_T_MAX | HWMON_T_MIN |
420
+ HWMON_T_TYPE | HWMON_T_FAULT),
448421 NULL
449422 };
450423
....@@ -459,8 +432,7 @@
459432 .info = lm95241_info,
460433 };
461434
462
-static int lm95241_probe(struct i2c_client *client,
463
- const struct i2c_device_id *id)
435
+static int lm95241_probe(struct i2c_client *client)
464436 {
465437 struct device *dev = &client->dev;
466438 struct lm95241_data *data;
....@@ -496,7 +468,7 @@
496468 .driver = {
497469 .name = DEVNAME,
498470 },
499
- .probe = lm95241_probe,
471
+ .probe_new = lm95241_probe,
500472 .id_table = lm95241_id,
501473 .detect = lm95241_detect,
502474 .address_list = normal_i2c,