mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Guenter Roeck <linux@roeck-us.net>
To: Wolfram Sang <wsa+renesas@sang-engineering.com>
Cc: linux-i2c@vger.kernel.org, Jean Delvare <jdelvare@suse.com>,
	linux-hwmon@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/3] hwmon: asb100: convert to i2c_new_dummy_device
Date: Mon, 22 Jul 2019 11:28:15 -0700	[thread overview]
Message-ID: <20190722182815.GA16669@roeck-us.net> (raw)
In-Reply-To: <20190722172611.3797-2-wsa+renesas@sang-engineering.com>

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;
>  	}
>  

  reply	other threads:[~2019-07-22 18:28 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-22 17:26 [PATCH 0/3] hwmon: convert subsystem to i2c_new_dummy_device() Wolfram Sang
2019-07-22 17:26 ` [PATCH 1/3] hwmon: asb100: convert to i2c_new_dummy_device Wolfram Sang
2019-07-22 18:28   ` Guenter Roeck [this message]
2019-07-22 17:26 ` [PATCH 2/3] hwmon: smm665: " Wolfram Sang
2019-07-22 18:29   ` Guenter Roeck
2019-07-22 17:26 ` [PATCH 3/3] hwmon: w83781d: " Wolfram Sang
2019-07-22 18:30   ` Guenter Roeck

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190722182815.GA16669@roeck-us.net \
    --to=linux@roeck-us.net \
    --cc=jdelvare@suse.com \
    --cc=linux-hwmon@vger.kernel.org \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=wsa+renesas@sang-engineering.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome