* [PATCH] spi/xilinx: Check number of slaves range
@ 2015-01-28 19:53 ` Ricardo Ribalda Delgado
0 siblings, 0 replies; 5+ messages in thread
From: Ricardo Ribalda Delgado @ 2015-01-28 19:53 UTC (permalink / raw)
To: Mark Brown, Michal Simek, Sören Brinkmann, linux-spi,
linux-arm-kernel, linux-kernel
Cc: Ricardo Ribalda
From: Ricardo Ribalda <ricardo.ribalda@gmail.com>
The core only supports up to 32 slaves, and the chipselect function
expects the same.
Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
---
v2: Change suggested by Mark Brown
-Namespace the constant
drivers/spi/spi-xilinx.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/drivers/spi/spi-xilinx.c b/drivers/spi/spi-xilinx.c
index 416b227..354dbb4 100644
--- a/drivers/spi/spi-xilinx.c
+++ b/drivers/spi/spi-xilinx.c
@@ -22,6 +22,8 @@
#include <linux/spi/xilinx_spi.h>
#include <linux/io.h>
+#define XILINX_SPI_MAX_CS 32
+
#define XILINX_SPI_NAME "xilinx_spi"
/* Register definitions as per "OPB Serial Peripheral Interface (SPI) (v1.00e)
@@ -354,6 +356,11 @@ static int xilinx_spi_probe(struct platform_device *pdev)
return -EINVAL;
}
+ if (num_cs > XILINX_SPI_MAX_CS) {
+ dev_err(&pdev->dev, "Invalid number of spi slaves\n");
+ return -EINVAL;
+ }
+
master = spi_alloc_master(&pdev->dev, sizeof(struct xilinx_spi));
if (!master)
return -ENODEV;
--
2.1.4
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH] spi/xilinx: Check number of slaves range
@ 2015-01-28 19:53 ` Ricardo Ribalda Delgado
0 siblings, 0 replies; 5+ messages in thread
From: Ricardo Ribalda Delgado @ 2015-01-28 19:53 UTC (permalink / raw)
To: linux-arm-kernel
From: Ricardo Ribalda <ricardo.ribalda@gmail.com>
The core only supports up to 32 slaves, and the chipselect function
expects the same.
Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
---
v2: Change suggested by Mark Brown
-Namespace the constant
drivers/spi/spi-xilinx.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/drivers/spi/spi-xilinx.c b/drivers/spi/spi-xilinx.c
index 416b227..354dbb4 100644
--- a/drivers/spi/spi-xilinx.c
+++ b/drivers/spi/spi-xilinx.c
@@ -22,6 +22,8 @@
#include <linux/spi/xilinx_spi.h>
#include <linux/io.h>
+#define XILINX_SPI_MAX_CS 32
+
#define XILINX_SPI_NAME "xilinx_spi"
/* Register definitions as per "OPB Serial Peripheral Interface (SPI) (v1.00e)
@@ -354,6 +356,11 @@ static int xilinx_spi_probe(struct platform_device *pdev)
return -EINVAL;
}
+ if (num_cs > XILINX_SPI_MAX_CS) {
+ dev_err(&pdev->dev, "Invalid number of spi slaves\n");
+ return -EINVAL;
+ }
+
master = spi_alloc_master(&pdev->dev, sizeof(struct xilinx_spi));
if (!master)
return -ENODEV;
--
2.1.4
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] spi/xilinx: Check number of slaves range
2015-01-28 19:53 ` Ricardo Ribalda Delgado
(?)
@ 2015-01-28 19:57 ` Mark Brown
-1 siblings, 0 replies; 5+ messages in thread
From: Mark Brown @ 2015-01-28 19:57 UTC (permalink / raw)
To: Ricardo Ribalda Delgado
Cc: Michal Simek, Sören Brinkmann, linux-spi, linux-arm-kernel,
linux-kernel
[-- Attachment #1: Type: text/plain, Size: 243 bytes --]
On Wed, Jan 28, 2015 at 08:53:39PM +0100, Ricardo Ribalda Delgado wrote:
> From: Ricardo Ribalda <ricardo.ribalda@gmail.com>
>
> The core only supports up to 32 slaves, and the chipselect function
> expects the same.
Applied, thanks.
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 473 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] spi/xilinx: Check number of slaves range
@ 2015-01-28 19:57 ` Mark Brown
0 siblings, 0 replies; 5+ messages in thread
From: Mark Brown @ 2015-01-28 19:57 UTC (permalink / raw)
To: Ricardo Ribalda Delgado
Cc: linux-arm-kernel, linux-kernel, Michal Simek,
Sören Brinkmann, linux-spi
[-- Attachment #1.1: Type: text/plain, Size: 243 bytes --]
On Wed, Jan 28, 2015 at 08:53:39PM +0100, Ricardo Ribalda Delgado wrote:
> From: Ricardo Ribalda <ricardo.ribalda@gmail.com>
>
> The core only supports up to 32 slaves, and the chipselect function
> expects the same.
Applied, thanks.
[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 473 bytes --]
[-- Attachment #2: Type: text/plain, Size: 176 bytes --]
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH] spi/xilinx: Check number of slaves range
@ 2015-01-28 19:57 ` Mark Brown
0 siblings, 0 replies; 5+ messages in thread
From: Mark Brown @ 2015-01-28 19:57 UTC (permalink / raw)
To: linux-arm-kernel
On Wed, Jan 28, 2015 at 08:53:39PM +0100, Ricardo Ribalda Delgado wrote:
> From: Ricardo Ribalda <ricardo.ribalda@gmail.com>
>
> The core only supports up to 32 slaves, and the chipselect function
> expects the same.
Applied, thanks.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20150128/8065cb29/attachment.sig>
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2015-01-29 1:34 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-28 19:53 [PATCH] spi/xilinx: Check number of slaves range Ricardo Ribalda Delgado
2015-01-28 19:53 ` Ricardo Ribalda Delgado
2015-01-28 19:57 ` Mark Brown
2015-01-28 19:57 ` Mark Brown
2015-01-28 19:57 ` Mark Brown
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.