[U-Boot] [PATCH 1/3] fpga: xilinx: Check for substring in device ID validation

Michal Simek michal.simek at xilinx.com
Thu Jan 14 14:35:51 CET 2016


From: Siva Durga Prasad Paladugu <siva.durga.paladugu at xilinx.com>

Check for substrings in deviceID validation check
so that it can support xa bitstreams also.

Signed-off-by: Siva Durga Prasad Paladugu <sivadur at xilinx.com>
Signed-off-by: Michal Simek <michal.simek at xilinx.com>
---

 drivers/fpga/xilinx.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/fpga/xilinx.c b/drivers/fpga/xilinx.c
index c765a74a25e0..d459a2f7a572 100644
--- a/drivers/fpga/xilinx.c
+++ b/drivers/fpga/xilinx.c
@@ -75,8 +75,8 @@ int fpga_loadbitstream(int devnum, char *fpgadata, size_t size,
 		buffer[i] = *dataptr++;
 
 	if (xdesc->name) {
-		i = strncmp(buffer, xdesc->name, strlen(xdesc->name));
-		if (i) {
+		i = (ulong)strstr(buffer, xdesc->name);
+		if (!i) {
 			printf("%s: Wrong bitstream ID for this device\n",
 			       __func__);
 			printf("%s: Bitstream ID %s, current device ID %d/%s\n",
-- 
1.9.1



More information about the U-Boot mailing list