Allow product names to have suffixes (like board revisions)
authorKeith Packard <keithp@keithp.com>
Fri, 26 Feb 2010 00:33:34 +0000 (16:33 -0800)
committerKeith Packard <keithp@keithp.com>
Fri, 26 Feb 2010 00:34:44 +0000 (16:34 -0800)
When looking for a board by product name, just look at the prefix of
the name instead of requiring an exact match. This will allow products
to have board version suffixes.

Signed-off-by: Keith Packard <keithp@keithp.com>
ao-tools/lib/cc-usbdev.c

index ed39c06..afa91d4 100644 (file)
@@ -258,7 +258,7 @@ match_dev(char *product, int serial)
                return NULL;
        for (i = 0; i < devs->ndev; i++) {
                dev = devs->dev[i];
-               if (product && strcmp (product, dev->product) != 0)
+               if (product && strncmp (product, dev->product, strlen(product)) != 0)
                        continue;
                if (serial && serial != dev->serial)
                        continue;