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

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.