| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * w83795.c - Linux kernel driver for hardware monitoring |
|---|
| 3 | 4 | * Copyright (C) 2008 Nuvoton Technology Corp. |
|---|
| 4 | 5 | * Wei Song |
|---|
| 5 | 6 | * 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. |
|---|
| 20 | 7 | * |
|---|
| 21 | 8 | * Supports following chips: |
|---|
| 22 | 9 | * |
|---|
| .. | .. |
|---|
| 2140 | 2127 | if (temp_chan >= 4) |
|---|
| 2141 | 2128 | break; |
|---|
| 2142 | 2129 | data->temp_mode |= 1 << temp_chan; |
|---|
| 2143 | | - /* fall through */ |
|---|
| 2130 | + fallthrough; |
|---|
| 2144 | 2131 | case 0x3: /* Thermistor */ |
|---|
| 2145 | 2132 | data->has_temp |= 1 << temp_chan; |
|---|
| 2146 | 2133 | break; |
|---|
| 2147 | 2134 | } |
|---|
| 2148 | 2135 | } |
|---|
| 2149 | 2136 | |
|---|
| 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) |
|---|
| 2152 | 2140 | { |
|---|
| 2153 | 2141 | int i; |
|---|
| 2154 | 2142 | u8 tmp; |
|---|
| .. | .. |
|---|
| 2161 | 2149 | return -ENOMEM; |
|---|
| 2162 | 2150 | |
|---|
| 2163 | 2151 | i2c_set_clientdata(client, data); |
|---|
| 2164 | | - data->chip_type = id->driver_data; |
|---|
| 2152 | + data->chip_type = i2c_match_id(w83795_id, client)->driver_data; |
|---|
| 2165 | 2153 | data->bank = i2c_smbus_read_byte_data(client, W83795_REG_BANKSEL); |
|---|
| 2166 | 2154 | mutex_init(&data->update_lock); |
|---|
| 2167 | 2155 | |
|---|
| .. | .. |
|---|
| 2269 | 2257 | .driver = { |
|---|
| 2270 | 2258 | .name = "w83795", |
|---|
| 2271 | 2259 | }, |
|---|
| 2272 | | - .probe = w83795_probe, |
|---|
| 2260 | + .probe_new = w83795_probe, |
|---|
| 2273 | 2261 | .remove = w83795_remove, |
|---|
| 2274 | 2262 | .id_table = w83795_id, |
|---|
| 2275 | 2263 | |
|---|