From: Naveen Krishna Chatradhi <ch.naveen@samsung.com>
To: linux-arm-kernel@lists.infradead.org,
spi-devel-general@lists.sourceforge.net,
linux-samsung-soc@vger.kernel.org
Cc: naveenkrishna.ch@gmail.com, broonie@kernel.org,
grant.likely@secretlab.ca, jaswinder.singh@linaro.org,
kgene.kim@samsung.com, cpgs@samsung.com,
devicetree@vger.kernel.org
Subject: [PATCH 2/3 v5] spi: s3c64xx: for DT platofrms always get the chipselect info from DT node
Date: Fri, 13 Jun 2014 09:29:51 +0530 [thread overview]
Message-ID: <1402631992-500-2-git-send-email-ch.naveen@samsung.com> (raw)
In-Reply-To: <1402631992-500-1-git-send-email-ch.naveen@samsung.com>
Use controller_data structure only for the Non Device tree platforms.
For Device tree platforms, always derive the chipselect info from
DT node.
Signed-off-by: Naveen Krishna Chatradhi <ch.naveen@samsung.com>
Reviewed-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk>
Tested-by: Doug Anderson <dianders@chromium.org>
---
Changes since v4:
1. Added reviewed by from Javier and Tested by from Doug
Changes since v3:
New change
drivers/spi/spi-s3c64xx.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/drivers/spi/spi-s3c64xx.c b/drivers/spi/spi-s3c64xx.c
index b888c66..f27e15d 100644
--- a/drivers/spi/spi-s3c64xx.c
+++ b/drivers/spi/spi-s3c64xx.c
@@ -795,14 +795,15 @@ static int s3c64xx_spi_setup(struct spi_device *spi)
int err;
sdd = spi_master_get_devdata(spi->master);
- if (!cs && spi->dev.of_node) {
+ if (spi->dev.of_node) {
cs = s3c64xx_get_slave_ctrldata(spi);
spi->controller_data = cs;
- }
-
- /* For the non-DT platforms derive chip selects from controller data */
- if (!spi->dev.of_node)
+ } else {
+ /* For the non-DT platforms derive chip
+ * selects from controller data
+ */
spi->cs_gpio = cs->line;
+ }
if (IS_ERR_OR_NULL(cs)) {
dev_err(&spi->dev, "No CS for SPI(%d)\n", spi->chip_select);
--
1.7.9.5
next prev parent reply other threads:[~2014-06-13 3:59 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-13 3:59 [PATCH 1/3 v5] spi: s3c64xx: fix broken "cs_gpios" usage in the driver Naveen Krishna Chatradhi
2014-06-13 3:59 ` Naveen Krishna Chatradhi [this message]
2014-06-13 3:59 ` [PATCH 3/3 v5] ARM: DTS: fix the chip select gpios definition in the SPI nodes Naveen Krishna Chatradhi
2014-06-20 21:18 ` [PATCH 1/3 v5] spi: s3c64xx: fix broken "cs_gpios" usage in the driver Doug Anderson
2014-06-21 9:51 ` Mark Brown
2014-06-21 17:23 ` Naveen Krishna Ch
2014-06-22 10:35 ` Mark Brown
2014-06-25 11:29 ` Kukjin Kim
2014-07-02 16:56 ` Mark Brown
2014-07-07 6:21 ` Naveen Krishna Ch
2014-07-07 7:32 ` Mark Brown
2014-07-07 8:31 ` Naveen Krishna Ch
2014-07-07 11:22 ` Javier Martinez Canillas
2014-07-11 11:04 ` Javier Martinez Canillas
2014-07-11 13:48 ` 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=1402631992-500-2-git-send-email-ch.naveen@samsung.com \
--to=ch.naveen@samsung.com \
--cc=broonie@kernel.org \
--cc=cpgs@samsung.com \
--cc=devicetree@vger.kernel.org \
--cc=grant.likely@secretlab.ca \
--cc=jaswinder.singh@linaro.org \
--cc=kgene.kim@samsung.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-samsung-soc@vger.kernel.org \
--cc=naveenkrishna.ch@gmail.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).