diff mbox series

[2/3] hwmon: smm665: convert to i2c_new_dummy_device

Message ID 20190722172611.3797-3-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/smm665.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Guenter Roeck July 22, 2019, 6:29 p.m. UTC | #1
On Mon, Jul 22, 2019 at 07:26:09PM +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/smm665.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/hwmon/smm665.c b/drivers/hwmon/smm665.c
> index d8c91c2cb8cf..6eff14fe395d 100644
> --- a/drivers/hwmon/smm665.c
> +++ b/drivers/hwmon/smm665.c
> @@ -586,10 +586,10 @@ static int smm665_probe(struct i2c_client *client,
>  
>  	data->client = client;
>  	data->type = id->driver_data;
> -	data->cmdreg = i2c_new_dummy(adapter, (client->addr & ~SMM665_REGMASK)
> +	data->cmdreg = i2c_new_dummy_device(adapter, (client->addr & ~SMM665_REGMASK)
>  				     | SMM665_CMDREG_BASE);
> -	if (!data->cmdreg)
> -		return -ENOMEM;
> +	if (IS_ERR(data->cmdreg))
> +		return PTR_ERR(data->cmdreg);
>  
>  	switch (data->type) {
>  	case smm465:
diff mbox series

Patch

diff --git a/drivers/hwmon/smm665.c b/drivers/hwmon/smm665.c
index d8c91c2cb8cf..6eff14fe395d 100644
--- a/drivers/hwmon/smm665.c
+++ b/drivers/hwmon/smm665.c
@@ -586,10 +586,10 @@  static int smm665_probe(struct i2c_client *client,
 
 	data->client = client;
 	data->type = id->driver_data;
-	data->cmdreg = i2c_new_dummy(adapter, (client->addr & ~SMM665_REGMASK)
+	data->cmdreg = i2c_new_dummy_device(adapter, (client->addr & ~SMM665_REGMASK)
 				     | SMM665_CMDREG_BASE);
-	if (!data->cmdreg)
-		return -ENOMEM;
+	if (IS_ERR(data->cmdreg))
+		return PTR_ERR(data->cmdreg);
 
 	switch (data->type) {
 	case smm465: