diff options
author | Michal Simek <michal.simek@xilinx.com> | 2013-07-08 15:29:17 +0200 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2013-07-15 11:45:53 +0100 |
commit | be3acdff943f46c32e9b2f453f0033bbae01a804 (patch) | |
tree | 65260bf7704908d2e55374ab1361a775da7345cf /drivers/spi/spi-xilinx.c | |
parent | ad3fdbcaf98dc1258f7ee1503703e7fcbc0d8d8e (diff) | |
download | talos-op-linux-be3acdff943f46c32e9b2f453f0033bbae01a804.tar.gz talos-op-linux-be3acdff943f46c32e9b2f453f0033bbae01a804.zip |
spi/xilinx: Use of_property_read_u32 for reading value from node
It simplifies driver probing.
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Diffstat (limited to 'drivers/spi/spi-xilinx.c')
-rw-r--r-- | drivers/spi/spi-xilinx.c | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/drivers/spi/spi-xilinx.c b/drivers/spi/spi-xilinx.c index a9b99a997f91..0b23408d357c 100644 --- a/drivers/spi/spi-xilinx.c +++ b/drivers/spi/spi-xilinx.c @@ -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) { |