drivertool: fix device names, add backwards compatibility

This commit is contained in:
Stefan Seyfried
2013-05-12 17:09:52 +02:00
parent 179e8559f5
commit 0219f7f135

View File

@@ -137,8 +137,8 @@ static struct ioctl_list n[] = {
static const char *devices[2] =
{
"/dev/cs_display",
"/dev/cs_ir"
"/dev/display",
"/dev/input/nevis_ir"
};
void usage(void)
@@ -234,7 +234,9 @@ int main(int argc, char **argv)
}
ret = 0;
while (n[i].text != NULL && strcmp(n[i].text, argv[1]) != 0)
/* allow the old VFD_ names for backwards compatibility */
while (n[i].text != NULL && strcmp(n[i].text, argv[1]) != 0 &&
!(strncmp(argv[1], "VFD_", 4) == 0 && strcmp(n[i].text + 2, argv[1] + 3) == 0))
i++;
if (!n[i].text || (n[i].type != TYPE_UINT_GET && argc < 3))