.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
---|
1 | 2 | /* |
---|
2 | 3 | * Copyright (c) 2017 Red Hat, Inc |
---|
3 | | - * |
---|
4 | | - * This program is free software; you can redistribute it and/or modify it |
---|
5 | | - * under the terms of the GNU General Public License version 2 as published by |
---|
6 | | - * the Free Software Foundation. |
---|
7 | 4 | */ |
---|
8 | 5 | |
---|
9 | 6 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt |
---|
.. | .. |
---|
193 | 190 | struct psmouse_smbus_dev *smbdev = data; |
---|
194 | 191 | unsigned short addr_list[] = { smbdev->board.addr, I2C_CLIENT_END }; |
---|
195 | 192 | struct i2c_adapter *adapter; |
---|
| 193 | + struct i2c_client *client; |
---|
196 | 194 | |
---|
197 | 195 | adapter = i2c_verify_adapter(dev); |
---|
198 | 196 | if (!adapter) |
---|
.. | .. |
---|
201 | 199 | if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_HOST_NOTIFY)) |
---|
202 | 200 | return 0; |
---|
203 | 201 | |
---|
204 | | - smbdev->client = i2c_new_probed_device(adapter, &smbdev->board, |
---|
205 | | - addr_list, NULL); |
---|
206 | | - if (!smbdev->client) |
---|
| 202 | + client = i2c_new_scanned_device(adapter, &smbdev->board, |
---|
| 203 | + addr_list, NULL); |
---|
| 204 | + if (IS_ERR(client)) |
---|
207 | 205 | return 0; |
---|
208 | 206 | |
---|
209 | 207 | /* We have our(?) device, stop iterating i2c bus. */ |
---|
| 208 | + smbdev->client = client; |
---|
210 | 209 | return 1; |
---|
211 | 210 | } |
---|
212 | 211 | |
---|