linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Rhyland Klein <rklein@nvidia.com>
Cc: Sachin Kamat <sachin.kamat@linaro.org>,
	"linux-iio@vger.kernel.org" <linux-iio@vger.kernel.org>,
	"jic23@cam.ac.uk" <jic23@cam.ac.uk>,
	"patches@linaro.org" <patches@linaro.org>
Subject: Re: [PATCH 7/8] staging: iio: light: isl29018: Use devm_iio_device_alloc
Date: Sat, 27 Jul 2013 12:30:43 +0100	[thread overview]
Message-ID: <51F3AF63.2030800@kernel.org> (raw)
In-Reply-To: <51ED4CD2.4070600@nvidia.com>

On 07/22/13 16:16, Rhyland Klein wrote:
> On 7/22/2013 7:03 AM, Sachin Kamat wrote:
>> Using devm_iio_device_alloc makes code simpler.
>>
>> Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
>> Cc: Rhyland Klein <rklein@nvidia.com>
Applied to the togreg branch of iio.git

Rhyland, please put any acked-by etc up here as it makes it easy
to find when applying patches (and I'm lazy)
>> ---
>>  drivers/staging/iio/light/isl29018.c |   16 +++++-----------
>>  1 file changed, 5 insertions(+), 11 deletions(-)
>>
>> diff --git a/drivers/staging/iio/light/isl29018.c b/drivers/staging/iio/light/isl29018.c
>> index 82478a5..351936c 100644
>> --- a/drivers/staging/iio/light/isl29018.c
>> +++ b/drivers/staging/iio/light/isl29018.c
>> @@ -550,11 +550,10 @@ static int isl29018_probe(struct i2c_client *client,
>>  	struct iio_dev *indio_dev;
>>  	int err;
>>  
>> -	indio_dev = iio_device_alloc(sizeof(*chip));
>> +	indio_dev = devm_iio_device_alloc(&client->dev, sizeof(*chip));
>>  	if (indio_dev == NULL) {
>>  		dev_err(&client->dev, "iio allocation fails\n");
>> -		err = -ENOMEM;
>> -		goto exit;
>> +		return -ENOMEM;
>>  	}
>>  	chip = iio_priv(indio_dev);
>>  
>> @@ -572,12 +571,12 @@ static int isl29018_probe(struct i2c_client *client,
>>  	if (IS_ERR(chip->regmap)) {
>>  		err = PTR_ERR(chip->regmap);
>>  		dev_err(chip->dev, "regmap initialization failed: %d\n", err);
>> -		goto exit;
>> +		return err;
>>  	}
>>  
>>  	err = isl29018_chip_init(chip);
>>  	if (err)
>> -		goto exit_iio_free;
>> +		return err;
>>  
>>  	indio_dev->info = &isl29108_info;
>>  	indio_dev->channels = isl29018_channels;
>> @@ -588,14 +587,10 @@ static int isl29018_probe(struct i2c_client *client,
>>  	err = iio_device_register(indio_dev);
>>  	if (err) {
>>  		dev_err(&client->dev, "iio registration fails\n");
>> -		goto exit_iio_free;
>> +		return err;
>>  	}
>>  
>>  	return 0;
>> -exit_iio_free:
>> -	iio_device_free(indio_dev);
>> -exit:
>> -	return err;
>>  }
>>  
>>  static int isl29018_remove(struct i2c_client *client)
>> @@ -604,7 +599,6 @@ static int isl29018_remove(struct i2c_client *client)
>>  
>>  	dev_dbg(&client->dev, "%s()\n", __func__);
>>  	iio_device_unregister(indio_dev);
>> -	iio_device_free(indio_dev);
>>  
>>  	return 0;
>>  }
>>
> 
> Thanks!
> 
> Acked-by: Rhyland Klein <rklein@nvidia.com>
> 

  reply	other threads:[~2013-07-27 10:30 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-22 11:02 [PATCH 0/8] Use devm_iio_device_alloc Sachin Kamat
2013-07-22 11:02 ` [PATCH 1/8] iio: at91: " Sachin Kamat
2013-07-27 11:24   ` Jonathan Cameron
2013-07-22 11:02 ` [PATCH 2/8] iio: exynos_adc: " Sachin Kamat
2013-07-27 11:25   ` Jonathan Cameron
2013-07-22 11:02 ` [PATCH 3/8] iio: max1363: " Sachin Kamat
2013-07-27 11:25   ` Jonathan Cameron
2013-07-22 11:02 ` [PATCH 4/8] iio: frequency: adf4350: Use devm_* APIs Sachin Kamat
2013-07-27 11:26   ` Jonathan Cameron
2013-07-22 11:02 ` [PATCH 5/8] staging: iio: mxs-lradc: Use devm_iio_device_alloc Sachin Kamat
2013-07-22 22:04   ` Marek Vasut
2013-07-27 11:29     ` Jonathan Cameron
2013-07-22 11:02 ` [PATCH 6/8] staging: iio: spear_adc: " Sachin Kamat
2013-07-27 11:29   ` Jonathan Cameron
2013-07-22 11:03 ` [PATCH 7/8] staging: iio: light: isl29018: " Sachin Kamat
2013-07-22 15:16   ` Rhyland Klein
2013-07-27 11:30     ` Jonathan Cameron [this message]
2013-07-22 11:03 ` [PATCH 8/8] staging: iio: light: isl29028: " Sachin Kamat
2013-07-27 11:31   ` Jonathan Cameron

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=51F3AF63.2030800@kernel.org \
    --to=jic23@kernel.org \
    --cc=jic23@cam.ac.uk \
    --cc=linux-iio@vger.kernel.org \
    --cc=patches@linaro.org \
    --cc=rklein@nvidia.com \
    --cc=sachin.kamat@linaro.org \
    /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;
as well as URLs for NNTP newsgroup(s).