public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] iio: dac: Convert ad5380 to devm_regmap_* APIs
@ 2012-06-15  8:40 Axel Lin
  2012-06-15  8:47 ` Lars-Peter Clausen
  0 siblings, 1 reply; 2+ messages in thread
From: Axel Lin @ 2012-06-15  8:40 UTC (permalink / raw)
  To: linux-kernel; +Cc: Lars-Peter Clausen, Jonathan Cameron, Greg Kroah-Hartman

Signed-off-by: Axel Lin <axel.lin@gmail.com>
---
 drivers/iio/dac/ad5380.c |   10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/drivers/iio/dac/ad5380.c b/drivers/iio/dac/ad5380.c
index 5dfb445..14991ac 100644
--- a/drivers/iio/dac/ad5380.c
+++ b/drivers/iio/dac/ad5380.c
@@ -373,7 +373,7 @@ static int __devinit ad5380_probe(struct device *dev, struct regmap *regmap,
 	if (indio_dev == NULL) {
 		dev_err(dev, "Failed to allocate iio device\n");
 		ret = -ENOMEM;
-		goto error_regmap_exit;
+		goto error_out;
 	}
 
 	st = iio_priv(indio_dev);
@@ -436,8 +436,7 @@ error_free_reg:
 	kfree(indio_dev->channels);
 error_free:
 	iio_device_free(indio_dev);
-error_regmap_exit:
-	regmap_exit(regmap);
+error_out:
 
 	return ret;
 }
@@ -456,7 +455,6 @@ static int __devexit ad5380_remove(struct device *dev)
 		regulator_put(st->vref_reg);
 	}
 
-	regmap_exit(st->regmap);
 	iio_device_free(indio_dev);
 
 	return 0;
@@ -485,7 +483,7 @@ static int __devinit ad5380_spi_probe(struct spi_device *spi)
 	const struct spi_device_id *id = spi_get_device_id(spi);
 	struct regmap *regmap;
 
-	regmap = regmap_init_spi(spi, &ad5380_regmap_config);
+	regmap = devm_regmap_init_spi(spi, &ad5380_regmap_config);
 
 	if (IS_ERR(regmap))
 		return PTR_ERR(regmap);
@@ -559,7 +557,7 @@ static int __devinit ad5380_i2c_probe(struct i2c_client *i2c,
 {
 	struct regmap *regmap;
 
-	regmap = regmap_init_i2c(i2c, &ad5380_regmap_config);
+	regmap = devm_regmap_init_i2c(i2c, &ad5380_regmap_config);
 
 	if (IS_ERR(regmap))
 		return PTR_ERR(regmap);
-- 
1.7.9.5




^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] iio: dac: Convert ad5380 to devm_regmap_* APIs
  2012-06-15  8:40 [PATCH] iio: dac: Convert ad5380 to devm_regmap_* APIs Axel Lin
@ 2012-06-15  8:47 ` Lars-Peter Clausen
  0 siblings, 0 replies; 2+ messages in thread
From: Lars-Peter Clausen @ 2012-06-15  8:47 UTC (permalink / raw)
  To: Axel Lin; +Cc: linux-kernel, Jonathan Cameron, Greg Kroah-Hartman

On 06/15/2012 10:40 AM, Axel Lin wrote:
> Signed-off-by: Axel Lin <axel.lin@gmail.com>

Acked-by: Lars-Peter Clausen <lars@metafoo.de>

Thanks.

> ---
>  drivers/iio/dac/ad5380.c |   10 ++++------
>  1 file changed, 4 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/iio/dac/ad5380.c b/drivers/iio/dac/ad5380.c
> index 5dfb445..14991ac 100644
> --- a/drivers/iio/dac/ad5380.c
> +++ b/drivers/iio/dac/ad5380.c
> @@ -373,7 +373,7 @@ static int __devinit ad5380_probe(struct device *dev, struct regmap *regmap,
>  	if (indio_dev == NULL) {
>  		dev_err(dev, "Failed to allocate iio device\n");
>  		ret = -ENOMEM;
> -		goto error_regmap_exit;
> +		goto error_out;
>  	}
>  
>  	st = iio_priv(indio_dev);
> @@ -436,8 +436,7 @@ error_free_reg:
>  	kfree(indio_dev->channels);
>  error_free:
>  	iio_device_free(indio_dev);
> -error_regmap_exit:
> -	regmap_exit(regmap);
> +error_out:
>  
>  	return ret;
>  }
> @@ -456,7 +455,6 @@ static int __devexit ad5380_remove(struct device *dev)
>  		regulator_put(st->vref_reg);
>  	}
>  
> -	regmap_exit(st->regmap);
>  	iio_device_free(indio_dev);
>  
>  	return 0;
> @@ -485,7 +483,7 @@ static int __devinit ad5380_spi_probe(struct spi_device *spi)
>  	const struct spi_device_id *id = spi_get_device_id(spi);
>  	struct regmap *regmap;
>  
> -	regmap = regmap_init_spi(spi, &ad5380_regmap_config);
> +	regmap = devm_regmap_init_spi(spi, &ad5380_regmap_config);
>  
>  	if (IS_ERR(regmap))
>  		return PTR_ERR(regmap);
> @@ -559,7 +557,7 @@ static int __devinit ad5380_i2c_probe(struct i2c_client *i2c,
>  {
>  	struct regmap *regmap;
>  
> -	regmap = regmap_init_i2c(i2c, &ad5380_regmap_config);
> +	regmap = devm_regmap_init_i2c(i2c, &ad5380_regmap_config);
>  
>  	if (IS_ERR(regmap))
>  		return PTR_ERR(regmap);


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-06-15  8:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-15  8:40 [PATCH] iio: dac: Convert ad5380 to devm_regmap_* APIs Axel Lin
2012-06-15  8:47 ` Lars-Peter Clausen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox