spi/xilinx: Use of_property_read_u32 for reading value from node
authorMichal Simek <michal.simek@xilinx.com>
Mon, 8 Jul 2013 13:29:17 +0000 (15:29 +0200)
committerMark Brown <broonie@linaro.org>
Mon, 15 Jul 2013 10:45:53 +0000 (11:45 +0100)
It simplifies driver probing.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
drivers/spi/spi-xilinx.c

index a9b99a997f91ef711814fa846bf00895eab0e3de..0b23408d357ce097842f762901b0de5fa716c0a1 100644 (file)
@@ -353,17 +353,9 @@ static int xilinx_spi_probe(struct platform_device *pdev)
        if (pdata) {
                num_cs = pdata->num_chipselect;
                bits_per_word = pdata->bits_per_word;
-       }
-
-       if (pdev->dev.of_node) {
-               const __be32 *prop;
-               int len;
-
-               /* number of slave select bits is required */
-               prop = of_get_property(pdev->dev.of_node, "xlnx,num-ss-bits",
-                                      &len);
-               if (prop && len >= sizeof(*prop))
-                       num_cs = __be32_to_cpup(prop);
+       } else {
+               of_property_read_u32(pdev->dev.of_node, "xlnx,num-ss-bits",
+                                         &num_cs);
        }
 
        if (!num_cs) {