linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Michal Simek <michal.simek@xilinx.com>
To: linux-kernel@vger.kernel.org
Cc: Michal Simek <monstr@monstr.eu>,
	Michal Simek <michal.simek@xilinx.com>,
	Mark Brown <broonie@kernel.org>,
	linux-spi <linux-spi@vger.kernel.org>,
	Grant Likely <grant.likely@linaro.org>,
	Rob Herring <rob.herring@calxeda.com>,
	spi-devel-general@lists.sourceforge.net,
	devicetree-discuss@lists.ozlabs.org
Subject: [PATCH v1 4/4] spi/xilinx: Use of_property_read_u32 for reading value from node
Date: Mon,  8 Jul 2013 15:29:17 +0200	[thread overview]
Message-ID: <95fea2ecead16435fc526b1d7f36a0a1ec1635ff.1373290150.git.michal.simek@xilinx.com> (raw)
In-Reply-To: <ff70173bee5f9223ffea2b92b903b4e46ef8b323.1373290150.git.michal.simek@xilinx.com>
In-Reply-To: <ff70173bee5f9223ffea2b92b903b4e46ef8b323.1373290150.git.michal.simek@xilinx.com>

[-- Attachment #1: Type: text/plain, Size: 914 bytes --]

It simplifies driver probing.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
---
 drivers/spi/spi-xilinx.c | 14 +++-----------
 1 file changed, 3 insertions(+), 11 deletions(-)

diff --git a/drivers/spi/spi-xilinx.c b/drivers/spi/spi-xilinx.c
index a6bb5b0..07a7bca 100644
--- a/drivers/spi/spi-xilinx.c
+++ b/drivers/spi/spi-xilinx.c
@@ -372,17 +372,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) {
--
1.8.2.3


[-- Attachment #2: Type: application/pgp-signature, Size: 198 bytes --]

  parent reply	other threads:[~2013-07-08 13:29 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-08 13:29 [PATCH v1 1/4] spi/xilinx: Remove CONFIG_OF from the driver Michal Simek
2013-07-08 13:29 ` [PATCH v1 2/4] spi/xilinx: Clean ioremap calling Michal Simek
2013-07-08 14:50   ` Mark Brown
2013-07-08 13:29 ` [PATCH v1 3/4] spi/xilinx: Simplify irq allocation Michal Simek
2013-07-08 14:49   ` Mark Brown
2013-07-08 15:48     ` Michal Simek
2013-07-08 16:26       ` Mark Brown
2013-07-09 14:15         ` Michal Simek
2013-07-09 14:47           ` Mark Brown
2013-07-09 14:53             ` Michal Simek
2013-07-12 14:00         ` Michal Simek
2013-08-22 13:10           ` Mark Brown
2013-07-08 13:29 ` Michal Simek [this message]
2013-07-08 14:51   ` [PATCH v1 4/4] spi/xilinx: Use of_property_read_u32 for reading value from node Mark Brown
2013-07-09  5:26     ` Michal Simek
2013-07-09  9:14       ` Mark Brown
2013-07-08 14:49 ` [PATCH v1 1/4] spi/xilinx: Remove CONFIG_OF from the driver Mark Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=95fea2ecead16435fc526b1d7f36a0a1ec1635ff.1373290150.git.michal.simek@xilinx.com \
    --to=michal.simek@xilinx.com \
    --cc=broonie@kernel.org \
    --cc=devicetree-discuss@lists.ozlabs.org \
    --cc=grant.likely@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-spi@vger.kernel.org \
    --cc=monstr@monstr.eu \
    --cc=rob.herring@calxeda.com \
    --cc=spi-devel-general@lists.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).