Commit 557d0841 authored by Wolfram Sang's avatar Wolfram Sang Committed by Dmitry Torokhov
Browse files

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: default avatarWolfram Sang <wsa+renesas@sang-engineering.com>
Link: https://lore.kernel.org/r/20200210165902.5250-1-wsa+renesas@sang-engineering.com


Signed-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
parent d0c5e7d4
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -190,6 +190,7 @@ static int psmouse_smbus_create_companion(struct device *dev, void *data)
	struct psmouse_smbus_dev *smbdev = data;
	unsigned short addr_list[] = { smbdev->board.addr, I2C_CLIENT_END };
	struct i2c_adapter *adapter;
	struct i2c_client *client;

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

	smbdev->client = i2c_new_probed_device(adapter, &smbdev->board,
	client = i2c_new_scanned_device(adapter, &smbdev->board,
					addr_list, NULL);
	if (!smbdev->client)
	if (IS_ERR(client))
		return 0;

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