forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-05-10 748e4f3d702def1a4bff191e0cf93b6a05340f01
kernel/drivers/hwmon/w83795.c
....@@ -1,22 +1,9 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * w83795.c - Linux kernel driver for hardware monitoring
34 * Copyright (C) 2008 Nuvoton Technology Corp.
45 * Wei Song
56 * Copyright (C) 2010 Jean Delvare <jdelvare@suse.de>
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 - version 2.
10
- *
11
- * This program is distributed in the hope that it will be useful,
12
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
- * GNU General Public License for more details.
15
- *
16
- * You should have received a copy of the GNU General Public License
17
- * along with this program; if not, write to the Free Software
18
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
19
- * 02110-1301 USA.
207 *
218 * Supports following chips:
229 *
....@@ -2140,15 +2127,16 @@
21402127 if (temp_chan >= 4)
21412128 break;
21422129 data->temp_mode |= 1 << temp_chan;
2143
- /* fall through */
2130
+ fallthrough;
21442131 case 0x3: /* Thermistor */
21452132 data->has_temp |= 1 << temp_chan;
21462133 break;
21472134 }
21482135 }
21492136
2150
-static int w83795_probe(struct i2c_client *client,
2151
- const struct i2c_device_id *id)
2137
+static const struct i2c_device_id w83795_id[];
2138
+
2139
+static int w83795_probe(struct i2c_client *client)
21522140 {
21532141 int i;
21542142 u8 tmp;
....@@ -2161,7 +2149,7 @@
21612149 return -ENOMEM;
21622150
21632151 i2c_set_clientdata(client, data);
2164
- data->chip_type = id->driver_data;
2152
+ data->chip_type = i2c_match_id(w83795_id, client)->driver_data;
21652153 data->bank = i2c_smbus_read_byte_data(client, W83795_REG_BANKSEL);
21662154 mutex_init(&data->update_lock);
21672155
....@@ -2269,7 +2257,7 @@
22692257 .driver = {
22702258 .name = "w83795",
22712259 },
2272
- .probe = w83795_probe,
2260
+ .probe_new = w83795_probe,
22732261 .remove = w83795_remove,
22742262 .id_table = w83795_id,
22752263