All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] iio: twl4030-madc: convert to DT only
@ 2016-11-12 10:21 Nicolae Rosia
  2016-11-12 13:21 ` Jonathan Cameron
  0 siblings, 1 reply; 4+ messages in thread
From: Nicolae Rosia @ 2016-11-12 10:21 UTC (permalink / raw)
  To: Jonathan Cameron
  Cc: Hartmut Knaack, Lars-Peter Clausen, Peter Meerwald-Stadler,
	linux-iio, Tony Lindgren, Nicolae Rosia

All users are DT only and it makes no sense to keep dead code.
twl4030_madc_platform_data is unused and can now be removed
from include/i2c/twl.h

Signed-off-by: Nicolae Rosia <Nicolae_Rosia@mentor.com>
---
 drivers/iio/adc/Kconfig        |  1 +
 drivers/iio/adc/twl4030-madc.c | 14 ++++----------
 2 files changed, 5 insertions(+), 10 deletions(-)

diff --git a/drivers/iio/adc/Kconfig b/drivers/iio/adc/Kconfig
index 99c0514..e7cd9b1 100644
--- a/drivers/iio/adc/Kconfig
+++ b/drivers/iio/adc/Kconfig
@@ -528,6 +528,7 @@ config TI_AM335X_ADC
 config TWL4030_MADC
 	tristate "TWL4030 MADC (Monitoring A/D Converter)"
 	depends on TWL4030_CORE
+	depends on OF
 	help
 	  This driver provides support for Triton TWL4030-MADC. The
 	  driver supports both RT and SW conversion methods.
diff --git a/drivers/iio/adc/twl4030-madc.c b/drivers/iio/adc/twl4030-madc.c
index 0c74869..885dbf2 100644
--- a/drivers/iio/adc/twl4030-madc.c
+++ b/drivers/iio/adc/twl4030-madc.c
@@ -745,14 +745,13 @@ static int twl4030_madc_set_power(struct twl4030_madc_data *madc, int on)
 static int twl4030_madc_probe(struct platform_device *pdev)
 {
 	struct twl4030_madc_data *madc;
-	struct twl4030_madc_platform_data *pdata = dev_get_platdata(&pdev->dev);
 	struct device_node *np = pdev->dev.of_node;
 	int irq, ret;
 	u8 regval;
 	struct iio_dev *iio_dev = NULL;
 
-	if (!pdata && !np) {
-		dev_err(&pdev->dev, "neither platform data nor Device Tree node available\n");
+	if (!np) {
+		dev_err(&pdev->dev, "no DT info\n");
 		return -EINVAL;
 	}
 
@@ -778,11 +777,8 @@ static int twl4030_madc_probe(struct platform_device *pdev)
 	 * the OMAP. The other one can be connected to the other processor such
 	 * as modem. Hence two separate ISR and IMR registers.
 	 */
-	if (pdata)
-		madc->use_second_irq = (pdata->irq_line != 1);
-	else
-		madc->use_second_irq = of_property_read_bool(np,
-				       "ti,system-uses-second-madc-irq");
+	madc->use_second_irq = of_property_read_bool(np,
+			       "ti,system-uses-second-madc-irq");
 
 	madc->imr = madc->use_second_irq ? TWL4030_MADC_IMR2 :
 					   TWL4030_MADC_IMR1;
@@ -903,13 +899,11 @@ static int twl4030_madc_remove(struct platform_device *pdev)
 	return 0;
 }
 
-#ifdef CONFIG_OF
 static const struct of_device_id twl_madc_of_match[] = {
 	{ .compatible = "ti,twl4030-madc", },
 	{ },
 };
 MODULE_DEVICE_TABLE(of, twl_madc_of_match);
-#endif
 
 static struct platform_driver twl4030_madc_driver = {
 	.probe = twl4030_madc_probe,
-- 
2.5.5


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

* Re: [PATCH] iio: twl4030-madc: convert to DT only
  2016-11-12 10:21 [PATCH] iio: twl4030-madc: convert to DT only Nicolae Rosia
@ 2016-11-12 13:21 ` Jonathan Cameron
  2016-11-12 17:56   ` Tony Lindgren
  0 siblings, 1 reply; 4+ messages in thread
From: Jonathan Cameron @ 2016-11-12 13:21 UTC (permalink / raw)
  To: Nicolae Rosia
  Cc: Hartmut Knaack, Lars-Peter Clausen, Peter Meerwald-Stadler,
	linux-iio, Tony Lindgren

On 12/11/16 10:21, Nicolae Rosia wrote:
> All users are DT only and it makes no sense to keep dead code.
> twl4030_madc_platform_data is unused and can now be removed
> from include/i2c/twl.h
> 
Whilst we don't 'have' to be nice to out of tree users, the advantage
in code reduction here is pretty limited.

So I'm doubtful unless Tony confirms that this is a sensible move and that
the rest of the elements of twl4030 support are going the same way.

Thanks,

Jonathan


> Signed-off-by: Nicolae Rosia <Nicolae_Rosia@mentor.com>
> ---
>  drivers/iio/adc/Kconfig        |  1 +
>  drivers/iio/adc/twl4030-madc.c | 14 ++++----------
>  2 files changed, 5 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/iio/adc/Kconfig b/drivers/iio/adc/Kconfig
> index 99c0514..e7cd9b1 100644
> --- a/drivers/iio/adc/Kconfig
> +++ b/drivers/iio/adc/Kconfig
> @@ -528,6 +528,7 @@ config TI_AM335X_ADC
>  config TWL4030_MADC
>  	tristate "TWL4030 MADC (Monitoring A/D Converter)"
>  	depends on TWL4030_CORE
> +	depends on OF
>  	help
>  	  This driver provides support for Triton TWL4030-MADC. The
>  	  driver supports both RT and SW conversion methods.
> diff --git a/drivers/iio/adc/twl4030-madc.c b/drivers/iio/adc/twl4030-madc.c
> index 0c74869..885dbf2 100644
> --- a/drivers/iio/adc/twl4030-madc.c
> +++ b/drivers/iio/adc/twl4030-madc.c
> @@ -745,14 +745,13 @@ static int twl4030_madc_set_power(struct twl4030_madc_data *madc, int on)
>  static int twl4030_madc_probe(struct platform_device *pdev)
>  {
>  	struct twl4030_madc_data *madc;
> -	struct twl4030_madc_platform_data *pdata = dev_get_platdata(&pdev->dev);
>  	struct device_node *np = pdev->dev.of_node;
>  	int irq, ret;
>  	u8 regval;
>  	struct iio_dev *iio_dev = NULL;
>  
> -	if (!pdata && !np) {
> -		dev_err(&pdev->dev, "neither platform data nor Device Tree node available\n");
> +	if (!np) {
> +		dev_err(&pdev->dev, "no DT info\n");
>  		return -EINVAL;
>  	}
>  
> @@ -778,11 +777,8 @@ static int twl4030_madc_probe(struct platform_device *pdev)
>  	 * the OMAP. The other one can be connected to the other processor such
>  	 * as modem. Hence two separate ISR and IMR registers.
>  	 */
> -	if (pdata)
> -		madc->use_second_irq = (pdata->irq_line != 1);
> -	else
> -		madc->use_second_irq = of_property_read_bool(np,
> -				       "ti,system-uses-second-madc-irq");
> +	madc->use_second_irq = of_property_read_bool(np,
> +			       "ti,system-uses-second-madc-irq");
>  
>  	madc->imr = madc->use_second_irq ? TWL4030_MADC_IMR2 :
>  					   TWL4030_MADC_IMR1;
> @@ -903,13 +899,11 @@ static int twl4030_madc_remove(struct platform_device *pdev)
>  	return 0;
>  }
>  
> -#ifdef CONFIG_OF
>  static const struct of_device_id twl_madc_of_match[] = {
>  	{ .compatible = "ti,twl4030-madc", },
>  	{ },
>  };
>  MODULE_DEVICE_TABLE(of, twl_madc_of_match);
> -#endif
>  
>  static struct platform_driver twl4030_madc_driver = {
>  	.probe = twl4030_madc_probe,
> 


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

* Re: [PATCH] iio: twl4030-madc: convert to DT only
  2016-11-12 13:21 ` Jonathan Cameron
@ 2016-11-12 17:56   ` Tony Lindgren
  2016-11-12 19:41     ` Nicolae Rosia
  0 siblings, 1 reply; 4+ messages in thread
From: Tony Lindgren @ 2016-11-12 17:56 UTC (permalink / raw)
  To: Jonathan Cameron
  Cc: Nicolae Rosia, Hartmut Knaack, Lars-Peter Clausen,
	Peter Meerwald-Stadler, linux-iio

* Jonathan Cameron <jic23@kernel.org> [161112 05:21]:
> On 12/11/16 10:21, Nicolae Rosia wrote:
> > All users are DT only and it makes no sense to keep dead code.
> > twl4030_madc_platform_data is unused and can now be removed
> > from include/i2c/twl.h
> > 
> Whilst we don't 'have' to be nice to out of tree users, the advantage
> in code reduction here is pretty limited.
>
> So I'm doubtful unless Tony confirms that this is a sensible move and that
> the rest of the elements of twl4030 support are going the same way.

Yeah well mach-omap2 is all device tree only now. We still do have
the platform_data init around in the unlikely case we still need
to revert it for some regression. But I'm queuing patches for v4.10
to drop the rest of the platform_data based init and will merge
them assuming no problems.

If this helps cleaning up the rest of the twl related code then
sure makes sense to me. If this is not blocking other clean-up,
maybe wait until v4.11 merge window to be safe on this one.

Regards,

Tony

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

* Re: [PATCH] iio: twl4030-madc: convert to DT only
  2016-11-12 17:56   ` Tony Lindgren
@ 2016-11-12 19:41     ` Nicolae Rosia
  0 siblings, 0 replies; 4+ messages in thread
From: Nicolae Rosia @ 2016-11-12 19:41 UTC (permalink / raw)
  To: Tony Lindgren
  Cc: Jonathan Cameron, Nicolae Rosia, Hartmut Knaack,
	Lars-Peter Clausen, Peter Meerwald-Stadler, linux-iio

> Yeah well mach-omap2 is all device tree only now. We still do have
> the platform_data init around in the unlikely case we still need
> to revert it for some regression. But I'm queuing patches for v4.10
> to drop the rest of the platform_data based init and will merge
> them assuming no problems.
>
> If this helps cleaning up the rest of the twl related code then
> sure makes sense to me. If this is not blocking other clean-up,
> maybe wait until v4.11 merge window to be safe on this one.
I may have rushed with this one then. I will repost it for v4.11, it's
not a blocker.

Regards,
Nicolae

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

end of thread, other threads:[~2016-11-12 19:41 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-12 10:21 [PATCH] iio: twl4030-madc: convert to DT only Nicolae Rosia
2016-11-12 13:21 ` Jonathan Cameron
2016-11-12 17:56   ` Tony Lindgren
2016-11-12 19:41     ` Nicolae Rosia

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.