mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v2 1/1] iio: adc: mxs-lradc-adc: Get rid of OF specifics
@ 2022-06-21 10:37 Andy Shevchenko
  2022-06-21 10:52 ` Andy Shevchenko
  0 siblings, 1 reply; 2+ messages in thread
From: Andy Shevchenko @ 2022-06-21 10:37 UTC (permalink / raw)
  To: Andy Shevchenko, linux-iio, linux-arm-kernel, linux-kernel
  Cc: Jonathan Cameron, Lars-Peter Clausen, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, NXP Linux Team

First of all, the additional conversion from vIRQ, and this is exactly
what is returned by platform_get_irq_byname(), to vIRQ is not needed.
Hence, drop no-op call to irq_of_parse_and_map().

Second, assign the firmware node instead of of_node.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Tested-by: Fabio Estevam <festevam@gmail.com>
---
v2: added property.h (Fabio), added tag (Fabio)
 drivers/iio/adc/mxs-lradc-adc.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/drivers/iio/adc/mxs-lradc-adc.c b/drivers/iio/adc/mxs-lradc-adc.c
index bca79a93cbe4..02d2ffafe34d 100644
--- a/drivers/iio/adc/mxs-lradc-adc.c
+++ b/drivers/iio/adc/mxs-lradc-adc.c
@@ -17,8 +17,8 @@
 #include <linux/mfd/core.h>
 #include <linux/mfd/mxs-lradc.h>
 #include <linux/module.h>
-#include <linux/of_irq.h>
 #include <linux/platform_device.h>
+#include <linux/property.h>
 #include <linux/sysfs.h>
 
 #include <linux/iio/buffer.h>
@@ -692,7 +692,7 @@ static int mxs_lradc_adc_probe(struct platform_device *pdev)
 	struct mxs_lradc_adc *adc;
 	struct iio_dev *iio;
 	struct resource *iores;
-	int ret, irq, virq, i, s, n;
+	int ret, irq, i, s, n;
 	u64 scale_uv;
 	const char **irq_name;
 
@@ -721,7 +721,7 @@ static int mxs_lradc_adc_probe(struct platform_device *pdev)
 	platform_set_drvdata(pdev, iio);
 
 	iio->name = pdev->name;
-	iio->dev.of_node = dev->parent->of_node;
+	device_set_node(&iio->dev, dev_fwnode(dev->parent));
 	iio->info = &mxs_lradc_adc_iio_info;
 	iio->modes = INDIO_DIRECT_MODE;
 	iio->masklength = LRADC_MAX_TOTAL_CHANS;
@@ -747,9 +747,7 @@ static int mxs_lradc_adc_probe(struct platform_device *pdev)
 		if (irq < 0)
 			return irq;
 
-		virq = irq_of_parse_and_map(dev->parent->of_node, irq);
-
-		ret = devm_request_irq(dev, virq, mxs_lradc_adc_handle_irq,
+		ret = devm_request_irq(dev, irq, mxs_lradc_adc_handle_irq,
 				       0, irq_name[i], iio);
 		if (ret)
 			return ret;
-- 
2.35.1


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

end of thread, other threads:[~2022-06-21 10:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-21 10:37 [PATCH v2 1/1] iio: adc: mxs-lradc-adc: Get rid of OF specifics Andy Shevchenko
2022-06-21 10:52 ` Andy Shevchenko

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

all inboxes | Powered by JetHome®