[3.16.y-ckt stable] Patch "spi: qup: Fix cs-num DT property parsing" has been added to staging queue
Luis Henriques
luis.henriques at canonical.com
Thu Apr 9 08:58:02 UTC 2015
This is a note to let you know that I have just added a patch titled
spi: qup: Fix cs-num DT property parsing
to the linux-3.16.y-queue branch of the 3.16.y-ckt extended stable tree
which can be found at:
http://kernel.ubuntu.com/git?p=ubuntu/linux.git;a=shortlog;h=refs/heads/linux-3.16.y-queue
This patch is scheduled to be released in version 3.16.7-ckt10.
If you, or anyone else, feels it should not be added to this tree, please
reply to this email.
For more information about the 3.16.y-ckt tree, see
https://wiki.ubuntu.com/Kernel/Dev/ExtendedStable
Thanks.
-Luis
------
>From 79e60f15382ed94447a0da47c66acc84b6a1f311 Mon Sep 17 00:00:00 2001
From: "Ivan T. Ivanov" <iivanov at mm-sol.com>
Date: Fri, 6 Mar 2015 17:26:17 +0200
Subject: spi: qup: Fix cs-num DT property parsing
commit 12cb89e37a0c25fae7a0f1d2e4985558db9d0b13 upstream.
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 at mm-sol.com>
Signed-off-by: Mark Brown <broonie at kernel.org>
[ luis: backported to 3.16: adjusted context ]
Signed-off-by: Luis Henriques <luis.henriques at canonical.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 c08da380cb23..7be89126c6ff 100644
--- a/drivers/spi/spi-qup.c
+++ b/drivers/spi/spi-qup.c
@@ -486,7 +486,7 @@ static int spi_qup_probe(struct platform_device *pdev)
struct resource *res;
struct device *dev;
void __iomem *base;
- u32 data, max_freq, iomode;
+ u32 data, max_freq, iomode, num_cs;
int ret, irq, size;
dev = &pdev->dev;
@@ -547,10 +547,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;
More information about the kernel-team
mailing list