diff mbox series

[RESEND] input: mouse: convert to i2c_new_scanned_device

Message ID 20200210165902.5250-1-wsa+renesas@sang-engineering.com (mailing list archive)
State Accepted
Commit 557d0841bc73fbd0da643b6647781bb1f790a84b
Headers show
Series [RESEND] input: mouse: convert to i2c_new_scanned_device | expand

Commit Message

Wolfram Sang Feb. 10, 2020, 4:59 p.m. UTC
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>
---

Build tested only.

 drivers/input/mouse/psmouse-smbus.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

Comments

Dmitry Torokhov Feb. 15, 2020, 11:49 p.m. UTC | #1
On Mon, Feb 10, 2020 at 05:59:02PM +0100, Wolfram Sang wrote:
> 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>

Applied, thank you.

> ---
> 
> Build tested only.
> 
>  drivers/input/mouse/psmouse-smbus.c | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/input/mouse/psmouse-smbus.c b/drivers/input/mouse/psmouse-smbus.c
> index 027efdd2b2ad..27358e543283 100644
> --- a/drivers/input/mouse/psmouse-smbus.c
> +++ b/drivers/input/mouse/psmouse-smbus.c
> @@ -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,12 @@ 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,
> -					       addr_list, NULL);
> -	if (!smbdev->client)
> +	client = i2c_new_scanned_device(adapter, &smbdev->board, addr_list, NULL);
> +	if (IS_ERR(client))
>  		return 0;
>  
>  	/* We have our(?) device, stop iterating i2c bus. */
> +	smbdev->client = client;
>  	return 1;
>  }
>  
> -- 
> 2.20.1
>
diff mbox series

Patch

diff --git a/drivers/input/mouse/psmouse-smbus.c b/drivers/input/mouse/psmouse-smbus.c
index 027efdd2b2ad..27358e543283 100644
--- a/drivers/input/mouse/psmouse-smbus.c
+++ b/drivers/input/mouse/psmouse-smbus.c
@@ -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,12 @@  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,
-					       addr_list, NULL);
-	if (!smbdev->client)
+	client = i2c_new_scanned_device(adapter, &smbdev->board, addr_list, NULL);
+	if (IS_ERR(client))
 		return 0;
 
 	/* We have our(?) device, stop iterating i2c bus. */
+	smbdev->client = client;
 	return 1;
 }