fpga: xilinx: Check for substring in device ID validation
authorSiva Durga Prasad Paladugu <siva.durga.paladugu@xilinx.com>
Mon, 11 Jan 2016 07:00:41 +0000 (12:30 +0530)
committerMichal Simek <michal.simek@xilinx.com>
Wed, 27 Jan 2016 14:55:53 +0000 (15:55 +0100)
Check for substrings in deviceID validation check
so that it can support xa bitstreams also.

Signed-off-by: Siva Durga Prasad Paladugu <sivadur@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
drivers/fpga/xilinx.c

index c765a74a25e0f17895b8010cfcbb646f735a5093..d459a2f7a572180954bdc34a82fcf39c32be868e 100644 (file)
@@ -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",