invarg() is specifically designed to print error messages when an
invalid argument is provided. Replace the generic fprintf() by
invarg() in can_parse_opt().
Signed-off-by: Vincent Mailhol <mailhol.vincent@wanadoo.fr>
Signed-off-by: David Ahern <dsahern@kernel.org>
cm.mask |= CAN_CTRLMODE_TDC_AUTO |
CAN_CTRLMODE_TDC_MANUAL;
} else {
- fprintf(stderr,
- "Error: argument of \"tdc-mode\" must be \"auto\", \"manual\" or \"off\", not \"%s\"\n",
+ invarg("\"tdc-mode\" must be either of \"auto\", \"manual\" or \"off\"",
*argv);
- exit (-1);
}
} else if (matches(*argv, "restart") == 0) {
__u32 val = 1;