uio_pdrv_genirq: convert to use device_property APIs
authorChris Packham <chris.packham@alliedtelesis.co.nz>
Mon, 8 Apr 2024 23:40:48 +0000 (11:40 +1200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 11 Apr 2024 12:40:29 +0000 (14:40 +0200)
Convert the uio_pdrv_genirq driver to use the device_property_* APIs
instead of the of_property_* ones. This allows UIO interrupts to be
defined via an ACPI overlay using the Device Tree namespace linkage.

Signed-off-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
Link: https://lore.kernel.org/r/20240408234050.2056374-2-chris.packham@alliedtelesis.co.nz
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/uio/uio_pdrv_genirq.c

index 63258b6accc468f794ba3b0047ff8860b18a387d..796f5be0a086a5cb98607db502a84c03517b432d 100644 (file)
@@ -23,8 +23,8 @@
 #include <linux/irq.h>
 
 #include <linux/of.h>
-#include <linux/of_platform.h>
-#include <linux/of_address.h>
+#include <linux/mod_devicetable.h>
+#include <linux/property.h>
 
 #define DRIVER_NAME "uio_pdrv_genirq"
 
@@ -110,7 +110,7 @@ static void uio_pdrv_genirq_cleanup(void *data)
 static int uio_pdrv_genirq_probe(struct platform_device *pdev)
 {
        struct uio_info *uioinfo = dev_get_platdata(&pdev->dev);
-       struct device_node *node = pdev->dev.of_node;
+       struct fwnode_handle *node = dev_fwnode(&pdev->dev);
        struct uio_pdrv_genirq_platdata *priv;
        struct uio_mem *uiomem;
        int ret = -EINVAL;
@@ -127,11 +127,11 @@ static int uio_pdrv_genirq_probe(struct platform_device *pdev)
                        return -ENOMEM;
                }
 
-               if (!of_property_read_string(node, "linux,uio-name", &name))
+               if (!device_property_read_string(&pdev->dev, "linux,uio-name", &name))
                        uioinfo->name = devm_kstrdup(&pdev->dev, name, GFP_KERNEL);
                else
                        uioinfo->name = devm_kasprintf(&pdev->dev, GFP_KERNEL,
-                                                      "%pOFn", node);
+                                                      "%pfwP", node);
 
                uioinfo->version = "devicetree";
                /* Multiple IRQs are not supported */