.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
---|
1 | 2 | /* |
---|
2 | 3 | * lm63.c - driver for the National Semiconductor LM63 temperature sensor |
---|
3 | 4 | * with integrated fan control |
---|
.. | .. |
---|
21 | 22 | * I had a explanation from National Semiconductor though. The two lower |
---|
22 | 23 | * bits of the read value have to be masked out. The value is still 16 bit |
---|
23 | 24 | * in width. |
---|
24 | | - * |
---|
25 | | - * This program is free software; you can redistribute it and/or modify |
---|
26 | | - * it under the terms of the GNU General Public License as published by |
---|
27 | | - * the Free Software Foundation; either version 2 of the License, or |
---|
28 | | - * (at your option) any later version. |
---|
29 | | - * |
---|
30 | | - * This program is distributed in the hope that it will be useful, |
---|
31 | | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
32 | | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
33 | | - * GNU General Public License for more details. |
---|
34 | | - * |
---|
35 | | - * You should have received a copy of the GNU General Public License |
---|
36 | | - * along with this program; if not, write to the Free Software |
---|
37 | | - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
---|
38 | 25 | */ |
---|
39 | 26 | |
---|
40 | 27 | #include <linux/module.h> |
---|
.. | .. |
---|
1100 | 1087 | (data->config_fan & 0x20) ? "manual" : "auto"); |
---|
1101 | 1088 | } |
---|
1102 | 1089 | |
---|
1103 | | -static int lm63_probe(struct i2c_client *client, |
---|
1104 | | - const struct i2c_device_id *id) |
---|
| 1090 | +static const struct i2c_device_id lm63_id[]; |
---|
| 1091 | + |
---|
| 1092 | +static int lm63_probe(struct i2c_client *client) |
---|
1105 | 1093 | { |
---|
1106 | 1094 | struct device *dev = &client->dev; |
---|
1107 | 1095 | struct device *hwmon_dev; |
---|
.. | .. |
---|
1119 | 1107 | if (client->dev.of_node) |
---|
1120 | 1108 | data->kind = (enum chips)of_device_get_match_data(&client->dev); |
---|
1121 | 1109 | else |
---|
1122 | | - data->kind = id->driver_data; |
---|
1123 | | - data->kind = id->driver_data; |
---|
| 1110 | + data->kind = i2c_match_id(lm63_id, client)->driver_data; |
---|
1124 | 1111 | if (data->kind == lm64) |
---|
1125 | 1112 | data->temp2_offset = 16000; |
---|
1126 | 1113 | |
---|
.. | .. |
---|
1154 | 1141 | }; |
---|
1155 | 1142 | MODULE_DEVICE_TABLE(i2c, lm63_id); |
---|
1156 | 1143 | |
---|
1157 | | -static const struct of_device_id lm63_of_match[] = { |
---|
| 1144 | +static const struct of_device_id __maybe_unused lm63_of_match[] = { |
---|
1158 | 1145 | { |
---|
1159 | 1146 | .compatible = "national,lm63", |
---|
1160 | 1147 | .data = (void *)lm63 |
---|
.. | .. |
---|
1177 | 1164 | .name = "lm63", |
---|
1178 | 1165 | .of_match_table = of_match_ptr(lm63_of_match), |
---|
1179 | 1166 | }, |
---|
1180 | | - .probe = lm63_probe, |
---|
| 1167 | + .probe_new = lm63_probe, |
---|
1181 | 1168 | .id_table = lm63_id, |
---|
1182 | 1169 | .detect = lm63_detect, |
---|
1183 | 1170 | .address_list = normal_i2c, |
---|