Skip to content

Commit 9742aec

Browse files
Sergei Shtylyovgregkh
authored andcommitted
testusb: remove all mentions of 'usbfs'
Commit 8a424bf (tools/usb: remove last USBFS user) removed 'usbfs' files from the source but retained mentions of 'usbfs' all over the place, most importantly in the misleading error messages printed in case USB device files are not there. Remove all the mentions of 'usbfs' for good now! Signed-off-by: Sergei Shtylyov <sshtylyov@dev.rtsoft.ru> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent ceb675a commit 9742aec

File tree

1 file changed

+13
-14
lines changed

1 file changed

+13
-14
lines changed

tools/usb/testusb.c

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -279,8 +279,7 @@ static int find_testdev(const char *name, const struct stat *sb, int flag)
279279

280280
entry->ifnum = ifnum;
281281

282-
/* FIXME ask usbfs what speed; update USBDEVFS_CONNECTINFO so
283-
* it tells about high speed etc */
282+
/* FIXME update USBDEVFS_CONNECTINFO so it tells about high speed etc */
284283

285284
fprintf(stderr, "%s speed\t%s\t%u\n",
286285
speed(entry->speed), entry->name, entry->ifnum);
@@ -351,7 +350,7 @@ static void *handle_testdev (void *arg)
351350
return arg;
352351
}
353352

354-
static const char *usbfs_dir_find(void)
353+
static const char *usb_dir_find(void)
355354
{
356355
static char udev_usb_path[] = "/dev/bus/usb";
357356

@@ -380,7 +379,7 @@ int main (int argc, char **argv)
380379
int c;
381380
struct testdev *entry;
382381
char *device;
383-
const char *usbfs_dir = NULL;
382+
const char *usb_dir = NULL;
384383
int all = 0, forever = 0, not = 0;
385384
int test = -1 /* all */;
386385
struct usbtest_param param;
@@ -407,8 +406,8 @@ int main (int argc, char **argv)
407406
case 'D': /* device, if only one */
408407
device = optarg;
409408
continue;
410-
case 'A': /* use all devices with specified usbfs dir */
411-
usbfs_dir = optarg;
409+
case 'A': /* use all devices with specified USB dir */
410+
usb_dir = optarg;
412411
/* FALL THROUGH */
413412
case 'a': /* use all devices */
414413
device = NULL;
@@ -449,7 +448,7 @@ int main (int argc, char **argv)
449448
"usage: %s [options]\n"
450449
"Options:\n"
451450
"\t-D dev only test specific device\n"
452-
"\t-A usbfs-dir\n"
451+
"\t-A usb-dir\n"
453452
"\t-a test all recognized devices\n"
454453
"\t-l loop forever(for stress test)\n"
455454
"\t-t testnum only run specified case\n"
@@ -470,18 +469,18 @@ int main (int argc, char **argv)
470469
goto usage;
471470
}
472471

473-
/* Find usbfs mount point */
474-
if (!usbfs_dir) {
475-
usbfs_dir = usbfs_dir_find();
476-
if (!usbfs_dir) {
477-
fputs ("usbfs files are missing\n", stderr);
472+
/* Find usb device subdirectory */
473+
if (!usb_dir) {
474+
usb_dir = usb_dir_find();
475+
if (!usb_dir) {
476+
fputs ("USB device files are missing\n", stderr);
478477
return -1;
479478
}
480479
}
481480

482481
/* collect and list the test devices */
483-
if (ftw (usbfs_dir, find_testdev, 3) != 0) {
484-
fputs ("ftw failed; is usbfs missing?\n", stderr);
482+
if (ftw (usb_dir, find_testdev, 3) != 0) {
483+
fputs ("ftw failed; are USB device files missing?\n", stderr);
485484
return -1;
486485
}
487486

0 commit comments

Comments
 (0)