FreeCalypso > hg > fc-usbser-tools
diff cp2102/read_partno.c @ 97:8d35346f1d46
cp2102 tools: accept "default" as device-selector
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Thu, 28 Sep 2023 03:26:11 +0000 |
parents | 9a15eb300ab0 |
children | 1cacc1ae56f0 |
line wrap: on
line diff
--- a/cp2102/read_partno.c Thu Sep 28 02:38:59 2023 +0000 +++ b/cp2102/read_partno.c Thu Sep 28 03:26:11 2023 +0000 @@ -14,6 +14,8 @@ #include "../libuwrap/find_dev.h" #include "cp210x_defs.h" +extern struct usb_device *find_cp2102_device(); + main(argc, argv) char **argv; { @@ -26,11 +28,7 @@ fprintf(stderr, "usage: %s device-selector\n", argv[0]); exit(1); } - dev = find_usbdev_by_desc_string(argv[1]); - if (!dev) { - fprintf(stderr, "error: specified USB device not found\n"); - exit(1); - } + dev = find_cp2102_device(argv[1]); usbh = usb_open(dev); if (!usbh) { fprintf(stderr, "error: usb_open() failed\n");