hc
2024-05-10 23fa18eaa71266feff7ba8d83022d9e1cc83c65a
kernel/drivers/hwmon/mcp3021.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * mcp3021.c - driver for Microchip MCP3021 and MCP3221
34 *
....@@ -9,11 +10,6 @@
910 * This driver export the value of analog input voltage to sysfs, the
1011 * voltage unit is mV. Through the sysfs interface, lm-sensors tool
1112 * can also display the input voltage.
12
- *
13
- * This program is free software; you can redistribute it and/or modify
14
- * it under the terms of the GNU General Public License as published by
15
- * the Free Software Foundation; either version 2 of the License, or
16
- * (at your option) any later version.
1713 */
1814
1915 #include <linux/kernel.h>
....@@ -104,8 +100,9 @@
104100
105101 static DEVICE_ATTR_RO(in0_input);
106102
107
-static int mcp3021_probe(struct i2c_client *client,
108
- const struct i2c_device_id *id)
103
+static const struct i2c_device_id mcp3021_id[];
104
+
105
+static int mcp3021_probe(struct i2c_client *client)
109106 {
110107 int err;
111108 struct mcp3021_data *data = NULL;
....@@ -136,7 +133,7 @@
136133 data->vdd = MCP3021_VDD_REF_DEFAULT;
137134 }
138135
139
- switch (id->driver_data) {
136
+ switch (i2c_match_id(mcp3021_id, client)->driver_data) {
140137 case mcp3021:
141138 data->sar_shift = MCP3021_SAR_SHIFT;
142139 data->sar_mask = MCP3021_SAR_MASK;
....@@ -201,7 +198,7 @@
201198 .name = "mcp3021",
202199 .of_match_table = of_match_ptr(of_mcp3021_match),
203200 },
204
- .probe = mcp3021_probe,
201
+ .probe_new = mcp3021_probe,
205202 .remove = mcp3021_remove,
206203 .id_table = mcp3021_id,
207204 };