hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/drivers/hwmon/tc74.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * An hwmon driver for the Microchip TC74
34 *
....@@ -7,11 +8,6 @@
78 * Copyright 2006 Stefan Roese, DENX Software Engineering
89 * Copyright 2008 Sean MacLennan, PIKA Technologies
910 * Copyright 2008 Frank Edelhaeuser, Spansion Inc.
10
- *
11
- * This program is free software; you can redistribute it and/or modify
12
- * it under the terms of the GNU General Public License as published by
13
- * the Free Software Foundation; either version 2 of the License, or
14
- * (at your option) any later version.
1511 */
1612
1713 #include <linux/bitops.h>
....@@ -86,7 +82,7 @@
8682 return ret;
8783 }
8884
89
-static ssize_t show_temp_input(struct device *dev,
85
+static ssize_t temp_input_show(struct device *dev,
9086 struct device_attribute *attr, char *buf)
9187 {
9288 struct tc74_data *data = dev_get_drvdata(dev);
....@@ -98,7 +94,7 @@
9894
9995 return sprintf(buf, "%d\n", data->temp_input * 1000);
10096 }
101
-static SENSOR_DEVICE_ATTR(temp1_input, S_IRUGO, show_temp_input, NULL, 0);
97
+static SENSOR_DEVICE_ATTR_RO(temp1_input, temp_input, 0);
10298
10399 static struct attribute *tc74_attrs[] = {
104100 &sensor_dev_attr_temp1_input.dev_attr.attr,
....@@ -107,8 +103,7 @@
107103
108104 ATTRIBUTE_GROUPS(tc74);
109105
110
-static int tc74_probe(struct i2c_client *client,
111
- const struct i2c_device_id *dev_id)
106
+static int tc74_probe(struct i2c_client *client)
112107 {
113108 struct device *dev = &client->dev;
114109 struct tc74_data *data;
....@@ -165,7 +160,7 @@
165160 .driver = {
166161 .name = "tc74",
167162 },
168
- .probe = tc74_probe,
163
+ .probe_new = tc74_probe,
169164 .id_table = tc74_id,
170165 };
171166