]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
soc/qman: Replace of_get_property() with portable equivalent
authorMadalin Bucur <madalin.bucur@nxp.com>
Wed, 16 Nov 2016 14:40:15 +0000 (16:40 +0200)
committerScott Wood <oss@buserror.net>
Wed, 23 Nov 2016 07:23:39 +0000 (01:23 -0600)
Use arch portable of_property_read_u32() instead, which takes
care of endianness conversions.

Signed-off-by: Madalin Bucur <madalin.bucur@nxp.com>
Signed-off-by: Claudiu Manoil <claudiu.manoil@nxp.com>
Signed-off-by: Scott Wood <oss@buserror.net>
drivers/soc/fsl/qbman/dpaa_sys.h
drivers/soc/fsl/qbman/qman_portal.c

index b63fd72295c6d22a3d2eae0e111111e6e324d657..2eaf3184f61dae754b746392c659c751b88da817 100644 (file)
@@ -38,6 +38,7 @@
 #include <linux/kthread.h>
 #include <linux/vmalloc.h>
 #include <linux/platform_device.h>
+#include <linux/of.h>
 #include <linux/of_reserved_mem.h>
 #include <linux/prefetch.h>
 #include <linux/genalloc.h>
index 148614388fcaba99f03886f10e99d23a3ac4abc1..0c3e8adae647b70e7342aed12f65f5ba5b0db973 100644 (file)
@@ -238,9 +238,9 @@ static int qman_portal_probe(struct platform_device *pdev)
        struct device_node *node = dev->of_node;
        struct qm_portal_config *pcfg;
        struct resource *addr_phys[2];
-       const u32 *channel;
        void __iomem *va;
-       int irq, len, cpu;
+       int irq, cpu, err;
+       u32 val;
 
        pcfg = devm_kmalloc(dev, sizeof(*pcfg), GFP_KERNEL);
        if (!pcfg)
@@ -264,13 +264,13 @@ static int qman_portal_probe(struct platform_device *pdev)
                return -ENXIO;
        }
 
-       channel = of_get_property(node, "cell-index", &len);
-       if (!channel || (len != 4)) {
+       err = of_property_read_u32(node, "cell-index", &val);
+       if (err) {
                dev_err(dev, "Can't get %s property 'cell-index'\n",
                        node->full_name);
-               return -ENXIO;
+               return err;
        }
-       pcfg->channel = *channel;
+       pcfg->channel = val;
        pcfg->cpu = -1;
        irq = platform_get_irq(pdev, 0);
        if (irq <= 0) {