+static int parse_to_get_card(const char *modarg_device, char *card) {
+ const char *name_p;
+ char *card_p;
+
+ if (!strchr(modarg_device, ',')) {
+ pa_log_error("Failed to parse device argument : no comma");
+ return -1;
+ }
+
+ name_p = modarg_device;
+ card_p = card;
+ while (*name_p != ',')
+ *(card_p++) = *(name_p++);
+ *card_p = '\0';
+
+ return 0;
+}
+
+static int parse_to_get_device(const char *modarg_device, char *device) {
+ const char *comma_p;
+ char *device_p;
+
+ if (!(comma_p = strchr(modarg_device, ','))) {
+ pa_log_error("Failed to parse device argument : no comma");
+ return -1;
+ }
+
+ comma_p++;
+ device_p = device;
+ while (*comma_p != '\0')
+ *(device_p++) = *(comma_p++);
+ *device_p = '\0';
+
+ return 0;
+}
+