Skip to content

Commit 557d084

Browse files
Wolfram Sangdtor
authored andcommitted
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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Dmitry Torokhov <[email protected]>
1 parent d0c5e7d commit 557d084

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

drivers/input/mouse/psmouse-smbus.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,7 @@ static int psmouse_smbus_create_companion(struct device *dev, void *data)
190190
struct psmouse_smbus_dev *smbdev = data;
191191
unsigned short addr_list[] = { smbdev->board.addr, I2C_CLIENT_END };
192192
struct i2c_adapter *adapter;
193+
struct i2c_client *client;
193194

194195
adapter = i2c_verify_adapter(dev);
195196
if (!adapter)
@@ -198,12 +199,13 @@ static int psmouse_smbus_create_companion(struct device *dev, void *data)
198199
if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_HOST_NOTIFY))
199200
return 0;
200201

201-
smbdev->client = i2c_new_probed_device(adapter, &smbdev->board,
202-
addr_list, NULL);
203-
if (!smbdev->client)
202+
client = i2c_new_scanned_device(adapter, &smbdev->board,
203+
addr_list, NULL);
204+
if (IS_ERR(client))
204205
return 0;
205206

206207
/* We have our(?) device, stop iterating i2c bus. */
208+
smbdev->client = client;
207209
return 1;
208210
}
209211

0 commit comments

Comments
 (0)