* [PATCH 1/2] iio: adc: ti_am335x_adc: Use devm_iio_device_alloc
@ 2013-07-23 8:46 Sachin Kamat
2013-07-23 8:46 ` [PATCH 2/2] iio: adc: Update ti_am335x_adc Kconfig entry Sachin Kamat
2013-07-27 11:48 ` [PATCH 1/2] iio: adc: ti_am335x_adc: Use devm_iio_device_alloc Jonathan Cameron
0 siblings, 2 replies; 4+ messages in thread
From: Sachin Kamat @ 2013-07-23 8:46 UTC (permalink / raw)
To: linux-iio; +Cc: rachna, jic23, jic23, sachin.kamat
Using devm_iio_device_alloc makes code simpler.
Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Cc: Rachna Patil <rachna@ti.com>
---
drivers/iio/adc/ti_am335x_adc.c | 13 ++++---------
1 file changed, 4 insertions(+), 9 deletions(-)
diff --git a/drivers/iio/adc/ti_am335x_adc.c b/drivers/iio/adc/ti_am335x_adc.c
index 4427e8e..a2bf109 100644
--- a/drivers/iio/adc/ti_am335x_adc.c
+++ b/drivers/iio/adc/ti_am335x_adc.c
@@ -201,11 +201,11 @@ static int tiadc_probe(struct platform_device *pdev)
return -EINVAL;
}
- indio_dev = iio_device_alloc(sizeof(struct tiadc_device));
+ indio_dev = devm_iio_device_alloc(&pdev->dev,
+ sizeof(struct tiadc_device));
if (indio_dev == NULL) {
dev_err(&pdev->dev, "failed to allocate iio device\n");
- err = -ENOMEM;
- goto err_ret;
+ return -ENOMEM;
}
adc_dev = iio_priv(indio_dev);
@@ -226,7 +226,7 @@ static int tiadc_probe(struct platform_device *pdev)
err = tiadc_channel_init(indio_dev, adc_dev->channels);
if (err < 0)
- goto err_free_device;
+ return err;
err = iio_device_register(indio_dev);
if (err)
@@ -238,9 +238,6 @@ static int tiadc_probe(struct platform_device *pdev)
err_free_channels:
tiadc_channels_remove(indio_dev);
-err_free_device:
- iio_device_free(indio_dev);
-err_ret:
return err;
}
@@ -256,8 +253,6 @@ static int tiadc_remove(struct platform_device *pdev)
step_en = get_adc_step_mask(adc_dev);
am335x_tsc_se_clr(adc_dev->mfd_tscadc, step_en);
- iio_device_free(indio_dev);
-
return 0;
}
--
1.7.9.5
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 2/2] iio: adc: Update ti_am335x_adc Kconfig entry
2013-07-23 8:46 [PATCH 1/2] iio: adc: ti_am335x_adc: Use devm_iio_device_alloc Sachin Kamat
@ 2013-07-23 8:46 ` Sachin Kamat
2013-07-27 11:48 ` Jonathan Cameron
2013-07-27 11:48 ` [PATCH 1/2] iio: adc: ti_am335x_adc: Use devm_iio_device_alloc Jonathan Cameron
1 sibling, 1 reply; 4+ messages in thread
From: Sachin Kamat @ 2013-07-23 8:46 UTC (permalink / raw)
To: linux-iio; +Cc: rachna, jic23, jic23, sachin.kamat
Make the string more readable to distinguish it from other TI ADCs.
Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
---
drivers/iio/adc/Kconfig | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/iio/adc/Kconfig b/drivers/iio/adc/Kconfig
index dd6bd1b..f725b45 100644
--- a/drivers/iio/adc/Kconfig
+++ b/drivers/iio/adc/Kconfig
@@ -165,7 +165,7 @@ config TI_ADC081C
called ti-adc081c.
config TI_AM335X_ADC
- tristate "TI's ADC driver"
+ tristate "TI's AM335X ADC driver"
depends on MFD_TI_AM335X_TSCADC
help
Say yes here to build support for Texas Instruments ADC
--
1.7.9.5
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 1/2] iio: adc: ti_am335x_adc: Use devm_iio_device_alloc
2013-07-23 8:46 [PATCH 1/2] iio: adc: ti_am335x_adc: Use devm_iio_device_alloc Sachin Kamat
2013-07-23 8:46 ` [PATCH 2/2] iio: adc: Update ti_am335x_adc Kconfig entry Sachin Kamat
@ 2013-07-27 11:48 ` Jonathan Cameron
1 sibling, 0 replies; 4+ messages in thread
From: Jonathan Cameron @ 2013-07-27 11:48 UTC (permalink / raw)
To: Sachin Kamat; +Cc: linux-iio, rachna
On 07/23/13 09:46, Sachin Kamat wrote:
> Using devm_iio_device_alloc makes code simpler.
>
> Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
> Cc: Rachna Patil <rachna@ti.com>
Applied to the togreg branch of iio.git.
Thanks
> ---
> drivers/iio/adc/ti_am335x_adc.c | 13 ++++---------
> 1 file changed, 4 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/iio/adc/ti_am335x_adc.c b/drivers/iio/adc/ti_am335x_adc.c
> index 4427e8e..a2bf109 100644
> --- a/drivers/iio/adc/ti_am335x_adc.c
> +++ b/drivers/iio/adc/ti_am335x_adc.c
> @@ -201,11 +201,11 @@ static int tiadc_probe(struct platform_device *pdev)
> return -EINVAL;
> }
>
> - indio_dev = iio_device_alloc(sizeof(struct tiadc_device));
> + indio_dev = devm_iio_device_alloc(&pdev->dev,
> + sizeof(struct tiadc_device));
> if (indio_dev == NULL) {
> dev_err(&pdev->dev, "failed to allocate iio device\n");
> - err = -ENOMEM;
> - goto err_ret;
> + return -ENOMEM;
> }
> adc_dev = iio_priv(indio_dev);
>
> @@ -226,7 +226,7 @@ static int tiadc_probe(struct platform_device *pdev)
>
> err = tiadc_channel_init(indio_dev, adc_dev->channels);
> if (err < 0)
> - goto err_free_device;
> + return err;
>
> err = iio_device_register(indio_dev);
> if (err)
> @@ -238,9 +238,6 @@ static int tiadc_probe(struct platform_device *pdev)
>
> err_free_channels:
> tiadc_channels_remove(indio_dev);
> -err_free_device:
> - iio_device_free(indio_dev);
> -err_ret:
> return err;
> }
>
> @@ -256,8 +253,6 @@ static int tiadc_remove(struct platform_device *pdev)
> step_en = get_adc_step_mask(adc_dev);
> am335x_tsc_se_clr(adc_dev->mfd_tscadc, step_en);
>
> - iio_device_free(indio_dev);
> -
> return 0;
> }
>
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 2/2] iio: adc: Update ti_am335x_adc Kconfig entry
2013-07-23 8:46 ` [PATCH 2/2] iio: adc: Update ti_am335x_adc Kconfig entry Sachin Kamat
@ 2013-07-27 11:48 ` Jonathan Cameron
0 siblings, 0 replies; 4+ messages in thread
From: Jonathan Cameron @ 2013-07-27 11:48 UTC (permalink / raw)
To: Sachin Kamat; +Cc: linux-iio, rachna
On 07/23/13 09:46, Sachin Kamat wrote:
> Make the string more readable to distinguish it from other TI ADCs.
>
> Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Very sensible.
Applied to the togreg branch of iio.git
Thanks,
> ---
> drivers/iio/adc/Kconfig | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/iio/adc/Kconfig b/drivers/iio/adc/Kconfig
> index dd6bd1b..f725b45 100644
> --- a/drivers/iio/adc/Kconfig
> +++ b/drivers/iio/adc/Kconfig
> @@ -165,7 +165,7 @@ config TI_ADC081C
> called ti-adc081c.
>
> config TI_AM335X_ADC
> - tristate "TI's ADC driver"
> + tristate "TI's AM335X ADC driver"
> depends on MFD_TI_AM335X_TSCADC
> help
> Say yes here to build support for Texas Instruments ADC
>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2013-07-27 10:48 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-07-23 8:46 [PATCH 1/2] iio: adc: ti_am335x_adc: Use devm_iio_device_alloc Sachin Kamat
2013-07-23 8:46 ` [PATCH 2/2] iio: adc: Update ti_am335x_adc Kconfig entry Sachin Kamat
2013-07-27 11:48 ` Jonathan Cameron
2013-07-27 11:48 ` [PATCH 1/2] iio: adc: ti_am335x_adc: Use devm_iio_device_alloc Jonathan Cameron
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).