Lines Matching refs:s
467 static char *find_eos(char *s) in find_eos() argument
469 while (*s && *s != ',') in find_eos()
470 s++; in find_eos()
471 if (*s) in find_eos()
472 s++; in find_eos()
473 return s; in find_eos()
476 static char *parse_uint(char *s, unsigned int *val) in parse_uint() argument
479 if (kstrtoull(s, 10, &res)) in parse_uint()
482 return find_eos(s); in parse_uint()
485 static char *parse_string(char *s, char *val, size_t val_size) in parse_string() argument
487 if (*s == '"' || *s == '\'') { in parse_string()
488 char c = *s; in parse_string()
489 s++; in parse_string()
490 while (*s && *s != c) { in parse_string()
492 *val++ = *s; in parse_string()
495 s++; in parse_string()
498 while (*s && *s != ',') { in parse_string()
500 *val++ = *s; in parse_string()
503 s++; in parse_string()
507 if (*s) in parse_string()
508 s++; in parse_string()
509 return s; in parse_string()
512 static char *parse_iface(char *s, unsigned int *val) in parse_iface() argument
514 if (!strncasecmp(s, "card", 4)) in parse_iface()
516 else if (!strncasecmp(s, "mixer", 5)) in parse_iface()
518 return find_eos(s); in parse_iface()
532 char buf2[256], *s, *os; in set_led_id() local
540 s = buf2; in set_led_id()
541 while (*s) { in set_led_id()
542 os = s; in set_led_id()
543 if (!strncasecmp(s, "numid=", 6)) { in set_led_id()
544 s = parse_uint(s + 6, &id.numid); in set_led_id()
545 } else if (!strncasecmp(s, "iface=", 6)) { in set_led_id()
546 s = parse_iface(s + 6, &id.iface); in set_led_id()
547 } else if (!strncasecmp(s, "device=", 7)) { in set_led_id()
548 s = parse_uint(s + 7, &id.device); in set_led_id()
549 } else if (!strncasecmp(s, "subdevice=", 10)) { in set_led_id()
550 s = parse_uint(s + 10, &id.subdevice); in set_led_id()
551 } else if (!strncasecmp(s, "name=", 5)) { in set_led_id()
552 s = parse_string(s + 5, id.name, sizeof(id.name)); in set_led_id()
553 } else if (!strncasecmp(s, "index=", 6)) { in set_led_id()
554 s = parse_uint(s + 6, &id.index); in set_led_id()
555 } else if (s == buf2) { in set_led_id()
556 while (*s) { in set_led_id()
557 if (*s < '0' || *s > '9') in set_led_id()
559 s++; in set_led_id()
561 if (*s == '\0') in set_led_id()
564 for (; *s >= ' '; s++); in set_led_id()
565 *s = '\0'; in set_led_id()
570 if (*s == ',') in set_led_id()
571 s++; in set_led_id()
572 if (s == os) in set_led_id()