diff mbox series

[1/3] hwmon: asb100: convert to i2c_new_dummy_device

Message ID 20190722172611.3797-2-wsa+renesas@sang-engineering.com (mailing list archive)
State Accepted
Headers show
Series hwmon: convert subsystem to i2c_new_dummy_device() | expand

Commit Message

Wolfram Sang July 22, 2019, 5:26 p.m. UTC
Move from i2c_new_dummy() to i2c_new_dummy_device(), so we now get an
ERRPTR which we use in error handling.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---

Generated with coccinelle. Build tested by me and buildbot. Not tested on HW.

 drivers/hwmon/asb100.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

Comments

Guenter Roeck July 22, 2019, 6:28 p.m. UTC | #1
On Mon, Jul 22, 2019 at 07:26:08PM +0200, Wolfram Sang wrote:
> Move from i2c_new_dummy() to i2c_new_dummy_device(), so we now get an
> ERRPTR which we use in error handling.
> 
> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>

Applied to hwmon-next.

Thanks,
Guenter

> ---
> 
> Generated with coccinelle. Build tested by me and buildbot. Not tested on HW.
> 
>  drivers/hwmon/asb100.c | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/hwmon/asb100.c b/drivers/hwmon/asb100.c
> index c9fa84b25678..4c609e23a4ef 100644
> --- a/drivers/hwmon/asb100.c
> +++ b/drivers/hwmon/asb100.c
> @@ -706,21 +706,21 @@ static int asb100_detect_subclients(struct i2c_client *client)
>  		goto ERROR_SC_2;
>  	}
>  
> -	data->lm75[0] = i2c_new_dummy(adapter, sc_addr[0]);
> -	if (!data->lm75[0]) {
> +	data->lm75[0] = i2c_new_dummy_device(adapter, sc_addr[0]);
> +	if (IS_ERR(data->lm75[0])) {
>  		dev_err(&client->dev,
>  			"subclient %d registration at address 0x%x failed.\n",
>  			1, sc_addr[0]);
> -		err = -ENOMEM;
> +		err = PTR_ERR(data->lm75[0]);
>  		goto ERROR_SC_2;
>  	}
>  
> -	data->lm75[1] = i2c_new_dummy(adapter, sc_addr[1]);
> -	if (!data->lm75[1]) {
> +	data->lm75[1] = i2c_new_dummy_device(adapter, sc_addr[1]);
> +	if (IS_ERR(data->lm75[1])) {
>  		dev_err(&client->dev,
>  			"subclient %d registration at address 0x%x failed.\n",
>  			2, sc_addr[1]);
> -		err = -ENOMEM;
> +		err = PTR_ERR(data->lm75[1]);
>  		goto ERROR_SC_3;
>  	}
>
diff mbox series

Patch

diff --git a/drivers/hwmon/asb100.c b/drivers/hwmon/asb100.c
index c9fa84b25678..4c609e23a4ef 100644
--- a/drivers/hwmon/asb100.c
+++ b/drivers/hwmon/asb100.c
@@ -706,21 +706,21 @@  static int asb100_detect_subclients(struct i2c_client *client)
 		goto ERROR_SC_2;
 	}
 
-	data->lm75[0] = i2c_new_dummy(adapter, sc_addr[0]);
-	if (!data->lm75[0]) {
+	data->lm75[0] = i2c_new_dummy_device(adapter, sc_addr[0]);
+	if (IS_ERR(data->lm75[0])) {
 		dev_err(&client->dev,
 			"subclient %d registration at address 0x%x failed.\n",
 			1, sc_addr[0]);
-		err = -ENOMEM;
+		err = PTR_ERR(data->lm75[0]);
 		goto ERROR_SC_2;
 	}
 
-	data->lm75[1] = i2c_new_dummy(adapter, sc_addr[1]);
-	if (!data->lm75[1]) {
+	data->lm75[1] = i2c_new_dummy_device(adapter, sc_addr[1]);
+	if (IS_ERR(data->lm75[1])) {
 		dev_err(&client->dev,
 			"subclient %d registration at address 0x%x failed.\n",
 			2, sc_addr[1]);
-		err = -ENOMEM;
+		err = PTR_ERR(data->lm75[1]);
 		goto ERROR_SC_3;
 	}