Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Input: psmouse - switch to using i2c_new_scanned_device()

Move from the deprecated i2c_new_probed_device() to the new
i2c_new_scanned_device(). Make use of the new ERRPTR if suitable.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Link: https://lore.kernel.org/r/20200210165902.5250-1-wsa+renesas@sang-engineering.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>

authored by

Wolfram Sang and committed by
Dmitry Torokhov
557d0841 d0c5e7d4

+5 -3
+5 -3
drivers/input/mouse/psmouse-smbus.c
··· 190 190 struct psmouse_smbus_dev *smbdev = data; 191 191 unsigned short addr_list[] = { smbdev->board.addr, I2C_CLIENT_END }; 192 192 struct i2c_adapter *adapter; 193 + struct i2c_client *client; 193 194 194 195 adapter = i2c_verify_adapter(dev); 195 196 if (!adapter) ··· 199 198 if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_HOST_NOTIFY)) 200 199 return 0; 201 200 202 - smbdev->client = i2c_new_probed_device(adapter, &smbdev->board, 203 - addr_list, NULL); 204 - if (!smbdev->client) 201 + client = i2c_new_scanned_device(adapter, &smbdev->board, 202 + addr_list, NULL); 203 + if (IS_ERR(client)) 205 204 return 0; 206 205 207 206 /* We have our(?) device, stop iterating i2c bus. */ 207 + smbdev->client = client; 208 208 return 1; 209 209 } 210 210