linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] spi: qup: Fix cs-num DT property parsing
@ 2015-03-06 15:26 Ivan T. Ivanov
  2015-03-06 15:26 ` [PATCH 2/2] spi: qup: Request CS GPIO's during probe Ivan T. Ivanov
       [not found] ` <1425655578-22400-1-git-send-email-iivanov-NEYub+7Iv8PQT0dZR+AlfA@public.gmane.org>
  0 siblings, 2 replies; 13+ messages in thread
From: Ivan T. Ivanov @ 2015-03-06 15:26 UTC (permalink / raw)
  To: Mark Brown; +Cc: linux-spi, linux-kernel, linux-arm-msm

num-cs is 32 bit property, don't read just upper 16 bits.

Fixes: 4a8573abe965 "spi: qup: Remove chip select function"
Signed-off-by: Ivan T. Ivanov <iivanov@mm-sol.com>
---
 drivers/spi/spi-qup.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/spi/spi-qup.c b/drivers/spi/spi-qup.c
index ff9cdbd..2b2c359 100644
--- a/drivers/spi/spi-qup.c
+++ b/drivers/spi/spi-qup.c
@@ -498,7 +498,7 @@ static int spi_qup_probe(struct platform_device *pdev)
 	struct resource *res;
 	struct device *dev;
 	void __iomem *base;
-	u32 max_freq, iomode;
+	u32 max_freq, iomode, num_cs;
 	int ret, irq, size;

 	dev = &pdev->dev;
@@ -550,10 +550,11 @@ static int spi_qup_probe(struct platform_device *pdev)
 	}

 	/* use num-cs unless not present or out of range */
-	if (of_property_read_u16(dev->of_node, "num-cs",
-			&master->num_chipselect) ||
-			(master->num_chipselect > SPI_NUM_CHIPSELECTS))
+	if (of_property_read_u32(dev->of_node, "num-cs", &num_cs) ||
+	    num_cs > SPI_NUM_CHIPSELECTS)
 		master->num_chipselect = SPI_NUM_CHIPSELECTS;
+	else
+		master->num_chipselect = num_cs;

 	master->bus_num = pdev->id;
 	master->mode_bits = SPI_CPOL | SPI_CPHA | SPI_CS_HIGH | SPI_LOOP;
--
1.9.1

^ permalink raw reply related	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2015-03-17 11:02 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-06 15:26 [PATCH 1/2] spi: qup: Fix cs-num DT property parsing Ivan T. Ivanov
2015-03-06 15:26 ` [PATCH 2/2] spi: qup: Request CS GPIO's during probe Ivan T. Ivanov
2015-03-06 18:34   ` Stephen Boyd
     [not found]     ` <54F9F31A.3050501-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2015-03-09  8:20       ` Ivan T. Ivanov
2015-03-09 18:53         ` Stephen Boyd
     [not found]           ` <54FDEC36.5080403-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2015-03-10  8:31             ` Ivan T. Ivanov
2015-03-17 11:02           ` Ivan T. Ivanov
     [not found]   ` <1425655578-22400-2-git-send-email-iivanov-NEYub+7Iv8PQT0dZR+AlfA@public.gmane.org>
2015-03-07 10:59     ` Mark Brown
     [not found]       ` <1425889415.2440.10.camel@mm-sol.com>
     [not found]         ` <20150309182841.GW28806@sirena.org.uk>
2015-03-10  8:10           ` Ivan T. Ivanov
     [not found]             ` <1425975056.2440.24.camel-NEYub+7Iv8PQT0dZR+AlfA@public.gmane.org>
2015-03-10 11:06               ` Mark Brown
2015-03-10 12:53                 ` Ivan T. Ivanov
     [not found]                   ` <1425991997.12581.1.camel-NEYub+7Iv8PQT0dZR+AlfA@public.gmane.org>
2015-03-10 20:47                     ` Mark Brown
     [not found] ` <1425655578-22400-1-git-send-email-iivanov-NEYub+7Iv8PQT0dZR+AlfA@public.gmane.org>
2015-03-07 11:01   ` [PATCH 1/2] spi: qup: Fix cs-num DT property parsing Mark Brown

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).