From adc14c4742eaaf6dccac7d823421c88df6737ebf Mon Sep 17 00:00:00 2001 From: Werner Almesberger Date: Sat, 9 Apr 2011 21:18:31 -0300 Subject: [PATCH] tools/lib/: make driver name matching case-sensitive and lower-case names Case-sensitive is the Unix way, and so is avoiding unnecessary upper-case. - atben.c (atben_driver): changed name from "Ben" to "ben" - atusb.c (atusb_driver): changed name from "USB" to "usb" - atrf.c (select_driver): made driver name matching case-sensitive --- tools/lib/atben.c | 2 +- tools/lib/atrf.c | 3 +-- tools/lib/atusb.c | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/tools/lib/atben.c b/tools/lib/atben.c index fa0c5eb..c5ba433 100644 --- a/tools/lib/atben.c +++ b/tools/lib/atben.c @@ -355,7 +355,7 @@ static int atben_interrupt(void *handle) struct atrf_driver atben_driver = { - .name = "Ben", + .name = "ben", .open = atben_open, .close = atben_close, .reset = NULL, diff --git a/tools/lib/atrf.c b/tools/lib/atrf.c index d799b0f..3216d90 100644 --- a/tools/lib/atrf.c +++ b/tools/lib/atrf.c @@ -14,7 +14,6 @@ #include #include #include -#include /* for strcasecmp */ #include "at86rf230.h" @@ -120,7 +119,7 @@ static const struct atrf_driver *select_driver(const char *arg, end = strchr(arg, 0); len = arg-end; for (drv = drivers; *drv; drv++) - if (!strncasecmp((*drv)->name, arg, len) && + if (!strncmp((*drv)->name, arg, len) && strlen((*drv)->name) == len) break; if (!*drv) { diff --git a/tools/lib/atusb.c b/tools/lib/atusb.c index 94480b5..2e06ae3 100644 --- a/tools/lib/atusb.c +++ b/tools/lib/atusb.c @@ -273,7 +273,7 @@ static int atusb_set_clkm(void *dsc, int mhz) struct atrf_driver atusb_driver = { - .name = "USB", + .name = "usb", .open = atusb_open, .close = atusb_close, .error = atusb_error,