/* make sure file offset is aligned with the calculated HDR offset */
if (tplg->bin_pos != tplg->next_hdr_pos) {
- SNDERR("error: New header is at offset 0x%zx but file"
- " offset 0x%zx is %s by %ld bytes\n",
+ SNDERR("New header is at offset 0x%zx but file"
+ " offset 0x%zx is %s by %ld bytes",
tplg->next_hdr_pos, tplg->bin_pos,
tplg->bin_pos > tplg->next_hdr_pos ? "ahead" : "behind",
labs(tplg->bin_pos - tplg->next_hdr_pos));
ret = write_block_header(tplg, tplg_type, elem->vendor_type,
tplg->version, elem->index, block_size, count);
if (ret < 0) {
- SNDERR("error: failed to write %s block %d\n",
+ SNDERR("failed to write %s block %d",
obj_name, ret);
return ret;
}
/* make sure we have written the correct size */
if (total_size != size) {
- SNDERR("error: size mismatch. Expected %zu wrote %zu\n",
+ SNDERR("size mismatch. Expected %zu wrote %zu",
size, total_size);
return -EIO;
}
tplg->version, 0,
sizeof(tplg->manifest) + tplg->manifest.priv.size, 1);
if (ret < 0) {
- SNDERR("error: failed to write manifest block\n");
+ SNDERR("failed to write manifest block");
return ret;
}
/* write manifest */
ret = write_manifest_data(tplg);
if (ret < 0) {
- SNDERR("failed to write manifest %d\n", ret);
+ SNDERR("failed to write manifest %d", ret);
return ret;
}
ret = write_elem_block(tplg, list, size,
tptr->tsoc, tptr->name);
if (ret < 0) {
- SNDERR("failed to write %s elements: %s\n",
+ SNDERR("failed to write %s elements: %s",
tptr->name, snd_strerror(-ret));
return ret;
}
verbose(tplg, "total size is 0x%zx/%zd\n", tplg->bin_pos, tplg->bin_pos);
if (total_size != tplg->bin_pos) {
- SNDERR("total size mismatch (%zd != %zd)\n",
+ SNDERR("total size mismatch (%zd != %zd)",
total_size, tplg->bin_pos);
return -EINVAL;
}
channel_id = lookup_channel(id);
if (channel_id < 0) {
- SNDERR("error: invalid channel %s\n", id);
+ SNDERR("invalid channel %s", id);
return -EINVAL;
}
if (strcmp(id, "access") == 0) {
err = parse_access_values(n, hdr);
if (err < 0) {
- SNDERR("error: failed to parse access");
+ SNDERR("failed to parse access");
return err;
}
continue;
}
if (!ref->elem) {
- SNDERR("error: cannot find '%s' referenced by"
- " control '%s'\n", ref->id, elem->id);
+ SNDERR("cannot find '%s' referenced by"
+ " control '%s'", ref->id, elem->id);
return -EINVAL;
} else if (err < 0)
return err;
return err;
}
if (!ref->elem) {
- SNDERR("error: cannot find '%s' referenced by"
- " control '%s'\n", ref->id, elem->id);
+ SNDERR("cannot find '%s' referenced by"
+ " control '%s'", ref->id, elem->id);
return -EINVAL;
}
}
n = snd_config_iterator_entry(i);
/* get ID */
- if (snd_config_get_id(n, &id) < 0) {
- SNDERR("error: cant get ID\n");
+ if (snd_config_get_id(n, &id) < 0)
return -EINVAL;
- }
/* get value */
if (tplg_get_integer(n, &val, 0))
else if (strcmp(id, "mute") == 0)
scale->mute = val;
else
- SNDERR("error: unknown key %s\n", id);
+ SNDERR("unknown id '%s'", id);
}
return 0;
if (strcmp(id, "scale") == 0) {
err = tplg_parse_tlv_dbscale(n, elem);
if (err < 0) {
- SNDERR("error: failed to DBScale");
+ SNDERR("failed to DBScale");
return err;
}
continue;
if (strcmp(id, "channel") == 0) {
if (ec->num_channels >= SND_SOC_TPLG_MAX_CHAN) {
- SNDERR("error: too many channels %s\n",
- elem->id);
+ SNDERR("too many channels %s", elem->id);
return -EINVAL;
}
if (strcmp(id, "channel") == 0) {
if (mc->num_channels >= SND_SOC_TPLG_MAX_CHAN) {
- SNDERR("error: too many channels %s\n",
- elem->id);
+ SNDERR("too many channels %s", elem->id);
return -EINVAL;
}
struct snd_soc_tplg_tlv_dbscale *scale;
if (!tlvt) {
- SNDERR("error: missing TLV data\n");
+ SNDERR("missing TLV data");
return -EINVAL;
}
/* TODO: add support for other TLV types */
default:
- SNDERR("error: unsupported TLV type %d\n", tlv->type);
+ SNDERR("unsupported TLV type %d", tlv->type);
break;
}
}
tplg_dbg(" Control Mixer: %s\n", mixer->hdr.name);
if (mixer->hdr.type != SND_SOC_TPLG_TYPE_MIXER) {
- SNDERR("error: invalid mixer type %d\n", mixer->hdr.type);
+ SNDERR("invalid mixer type %d", mixer->hdr.type);
return -EINVAL;
}
tplg_dbg(" Control Enum: %s\n", enum_ctl->hdr.name);
if (enum_ctl->hdr.type != SND_SOC_TPLG_TYPE_ENUM) {
- SNDERR("error: invalid enum type %d\n", enum_ctl->hdr.type);
+ SNDERR("invalid enum type %d", enum_ctl->hdr.type);
return -EINVAL;
}
tplg_dbg(" Control Bytes: %s\n", bytes_ctl->hdr.name);
if (bytes_ctl->hdr.type != SND_SOC_TPLG_TYPE_BYTES) {
- SNDERR("error: invalid bytes type %d\n", bytes_ctl->hdr.type);
+ SNDERR("invalid bytes type %d", bytes_ctl->hdr.type);
return -EINVAL;
}
if (be->hdr.access & SNDRV_CTL_ELEM_ACCESS_TLV_CALLBACK) {
if ((be->hdr.access & SNDRV_CTL_ELEM_ACCESS_TLV_READWRITE)
!= SNDRV_CTL_ELEM_ACCESS_TLV_READWRITE) {
- SNDERR("error: Invalid TLV bytes control access 0x%x\n",
+ SNDERR("Invalid TLV bytes control access 0x%x",
be->hdr.access);
tplg_elem_free(elem);
return -EINVAL;
}
if (!ref->elem) {
- SNDERR("error: cannot find '%s'"
- " referenced by widget '%s'\n",
+ SNDERR("cannot find '%s' referenced by widget '%s'",
ref->id, elem->id);
return -EINVAL;
}
elem = list_entry(pos, struct tplg_elem, list);
if (!elem->widget || elem->type != SND_TPLG_TYPE_DAPM_WIDGET) {
- SNDERR("error: invalid widget '%s'\n",
- elem->id);
+ SNDERR("invalid widget '%s'", elem->id);
return -EINVAL;
}
elem = list_entry(pos, struct tplg_elem, list);
if (!elem->route || elem->type != SND_TPLG_TYPE_DAPM_GRAPH) {
- SNDERR("error: invalid route '%s'\n",
- elem->id);
+ SNDERR("invalid route '%s'", elem->id);
return -EINVAL;
}
/* validate sink */
if (strlen(route->sink) <= 0) {
- SNDERR("error: no sink\n");
+ SNDERR("no sink");
return -EINVAL;
}
if (!tplg_elem_lookup(&tplg->widget_list, route->sink,
SND_TPLG_TYPE_DAPM_WIDGET, SND_TPLG_INDEX_ALL)) {
- SNDERR("warning: undefined sink widget/stream '%s'\n",
- route->sink);
+ SNDERR("undefined sink widget/stream '%s'", route->sink);
}
/* validate control name */
SND_TPLG_TYPE_MIXER, elem->index) &&
!tplg_elem_lookup(&tplg->enum_list, route->control,
SND_TPLG_TYPE_ENUM, elem->index)) {
- SNDERR("warning: Undefined mixer/enum control '%s'\n",
- route->control);
+ SNDERR("Undefined mixer/enum control '%s'",
+ route->control);
}
}
/* validate source */
if (strlen(route->source) <= 0) {
- SNDERR("error: no source\n");
+ SNDERR("no source");
return -EINVAL;
}
if (!tplg_elem_lookup(&tplg->widget_list, route->source,
SND_TPLG_TYPE_DAPM_WIDGET, SND_TPLG_INDEX_ALL)) {
- SNDERR("warning: Undefined source widget/stream '%s'\n",
- route->source);
+ SNDERR("Undefined source widget/stream '%s'",
+ route->source);
}
/* add graph to manifest */
len = strlen(buf);
if (len <= 2) {
- SNDERR("error: invalid route \"%s\"\n", buf);
+ SNDERR("invalid route \"%s\"", buf);
return -EINVAL;
}
if (buf[i] == ',')
goto second;
}
- SNDERR("error: invalid route \"%s\"\n", buf);
+ SNDERR("invalid route \"%s\"", buf);
return -EINVAL;
second:
goto done;
}
- SNDERR("error: invalid route \"%s\"\n", buf);
+ SNDERR("invalid route \"%s\"", buf);
return -EINVAL;
done:
int index = -1;
if (snd_config_get_type(cfg) != SND_CONFIG_TYPE_COMPOUND) {
- SNDERR("error: compound is expected for dapm graph definition\n");
+ SNDERR("compound is expected for dapm graph definition");
return -EINVAL;
}
if (strcmp(id, "lines") == 0) {
if (index < 0) {
- SNDERR("error: failed to parse dapm graph %s, missing index\n",
+ SNDERR("failed to parse dapm graph %s, missing index",
graph_id);
return -EINVAL;
}
err = tplg_parse_routes(tplg, n, index);
if (err < 0) {
- SNDERR("error: failed to parse dapm graph %s\n",
+ SNDERR("failed to parse dapm graph %s",
graph_id);
return err;
}
widget_type = lookup_widget(val);
if (widget_type < 0){
- SNDERR("Widget '%s': Unsupported widget type %s\n",
+ SNDERR("widget '%s': Unsupported widget type %s",
elem->id, val);
return -EINVAL;
}
break;
default:
- SNDERR("error: widget %s: invalid type %d for ctl %d\n",
+ SNDERR("widget %s: invalid type %d for ctl %d",
wt->name, ct->type, i);
break;
}
priv = &elem->pcm->priv;
break;
default:
- SNDERR("error: '%s': no support for private data for type %d\n",
+ SNDERR("'%s': no support for private data for type %d",
elem->id, elem->type);
}
}
if (cfg_type != SND_CONFIG_TYPE_COMPOUND) {
- SNDERR("error: compound type expected for %s", elem->id);
+ SNDERR("compound type expected for %s", elem->id);
return -EINVAL;
}
fp = fopen(filename, "r");
if (fp == NULL) {
- SNDERR("error: invalid data file path '%s'\n",
- filename);
+ SNDERR("invalid data file path '%s'", filename);
return -errno;
}
size = ftell(fp);
fseek(fp, 0L, SEEK_SET);
if (size <= 0) {
- SNDERR("error: invalid data file size %zu\n", size);
+ SNDERR("invalid data file size %zu", size);
ret = -EINVAL;
goto err;
}
if (size > TPLG_MAX_PRIV_SIZE) {
- SNDERR("error: data file too big %zu\n", size);
+ SNDERR("data file too big %zu", size);
ret = -EINVAL;
goto err;
}
if ((errno == ERANGE && val == ULONG_MAX)
|| (errno != 0 && val == 0)
|| (val > UCHAR_MAX)) {
- SNDERR("error: invalid value for uuid\n");
+ SNDERR("invalid value for uuid");
ret = -EINVAL;
goto out;
}
}
if (values < 16) {
- SNDERR("error: less than 16 integers for uuid\n");
+ SNDERR("less than 16 integers for uuid");
ret = -EINVAL;
}
num = get_hex_num(value);
if (num <= 0) {
- SNDERR("error: malformed hex variable list %s\n", value);
+ SNDERR("malformed hex variable list %s", value);
return -EINVAL;
}
priv = elem->data;
if (size > TPLG_MAX_PRIV_SIZE) {
- SNDERR("error: data too big %d\n", size);
+ SNDERR("data too big %d", size);
return -EINVAL;
}
return tokens->token[i].value;
}
- SNDERR("error: cannot find token id '%s'\n", token_id);
+ SNDERR("cannot find token id '%s'", token_id);
return -1;
}
* tuple_set->num_tuples;
size += set_size;
if (size > TPLG_MAX_PRIV_SIZE) {
- SNDERR("error: data too big %d\n", size);
+ SNDERR("data too big %d", size);
return -EINVAL;
}
ref->id, SND_TPLG_TYPE_TUPLE, elem->index);
tuples = ref->elem;
if (!tuples) {
- SNDERR("error: cannot find tuples %s\n", ref->id);
+ SNDERR("cannot find tuples %s", ref->id);
return -EINVAL;
}
tokens = get_tokens(tplg, tuples);
if (!tokens) {
- SNDERR("error: cannot find token for %s\n", ref->id);
+ SNDERR("cannot find token for %s", ref->id);
return -EINVAL;
}
type = get_tuple_type(id);
if (type < 0) {
- SNDERR("error: invalid tuple type '%s'", id);
+ SNDERR("invalid tuple type '%s'", id);
return type;
}
case SND_SOC_TPLG_TUPLE_TYPE_WORD:
ival = tplg_get_unsigned(n, &tuple_val, 0);
if (ival < 0) {
- SNDERR("error: tuple %s: %s\n", id, snd_strerror(ival));
+ SNDERR("tuple %s: %s", id, snd_strerror(ival));
goto err;
}
&& tuple_val > USHRT_MAX)
|| (type == SND_SOC_TPLG_TUPLE_TYPE_BYTE
&& tuple_val > UCHAR_MAX)) {
- SNDERR("error: tuple %s: invalid value\n", id);
+ SNDERR("tuple %s: invalid value", id);
goto err;
}
if (snd_config_get_type(cfg) != SND_CONFIG_TYPE_COMPOUND) {
if (snd_config_get_id(cfg, &id) >= 0)
- SNDERR("error: compound type expected for %s", id);
+ SNDERR("compound type expected for %s", id);
return -EINVAL;
}
snd_config_for_each(i, next, cfg) {
n = snd_config_iterator_entry(i);
if (snd_config_get_type(n) != SND_CONFIG_TYPE_COMPOUND) {
- SNDERR("error: compound type expected for %s, is %d",
- id, snd_config_get_type(n));
+ SNDERR("compound type expected for %s, is %d",
+ id, snd_config_get_type(n));
return -EINVAL;
}
int err;
if (!list_empty(&tplg->manifest_list)) {
- SNDERR("error: already has manifest data\n");
+ SNDERR("already has manifest data");
return -EINVAL;
}
if (strcmp(id, "file") == 0) {
err = tplg_parse_data_file(n, elem);
if (err < 0) {
- SNDERR("error: failed to parse data file\n");
+ SNDERR("failed to parse data file");
return err;
}
continue;
if (strcmp(id, "bytes") == 0) {
err = tplg_parse_data_hex(n, elem, 1);
if (err < 0) {
- SNDERR("error: failed to parse data bytes\n");
+ SNDERR("failed to parse data bytes");
return err;
}
continue;
if (strcmp(id, "shorts") == 0) {
err = tplg_parse_data_hex(n, elem, 2);
if (err < 0) {
- SNDERR("error: failed to parse data shorts\n");
+ SNDERR("failed to parse data shorts");
return err;
}
continue;
if (strcmp(id, "words") == 0) {
err = tplg_parse_data_hex(n, elem, 4);
if (err < 0) {
- SNDERR("error: failed to parse data words\n");
+ SNDERR("failed to parse data words");
return err;
}
continue;
ref_elem = tplg_elem_lookup(&tplg->pdata_list,
ref->id, SND_TPLG_TYPE_DATA, elem->index);
if (!ref_elem) {
- SNDERR("error: cannot find data '%s' referenced by"
- " element '%s'\n", ref->id, elem->id);
+ SNDERR("cannot find data '%s' referenced by"
+ " element '%s'", ref->id, elem->id);
return -EINVAL;
}
return -EINVAL;
if (snd_config_get_type(cfg) != SND_CONFIG_TYPE_COMPOUND) {
- SNDERR("error: compound type expected for %s", id);
+ SNDERR("compound type expected for %s", id);
return -EINVAL;
}
n = snd_config_iterator_entry(i);
if (snd_config_get_type(cfg) != SND_CONFIG_TYPE_COMPOUND) {
- SNDERR("error: compound type expected for %s, is %d",
+ SNDERR("compound type expected for %s, is %d",
id, snd_config_get_type(cfg));
return -EINVAL;
}
int err;
if (snd_config_get_type(cfg) != SND_CONFIG_TYPE_COMPOUND) {
- SNDERR("error: compound type expected at top level");
+ SNDERR("compound type expected at top level");
return -EINVAL;
}
}
if (parser == NULL) {
- SNDERR("error: unknown section %s\n", id);
+ SNDERR("unknown section %s", id);
continue;
}
ret = snd_config_load(top, in);
if (ret < 0) {
- SNDERR("error: could not load configuration");
+ SNDERR("could not load configuration");
snd_config_delete(top);
return ret;
}
ret = tplg_parse_config(tplg, top);
snd_config_delete(top);
if (ret < 0) {
- SNDERR("error: failed to parse topology");
+ SNDERR("failed to parse topology");
return ret;
}
err = snd_input_buffer_open(&in, buf, size);
if (err < 0) {
- SNDERR("error: could not create input buffer");
+ SNDERR("could not create input buffer");
return err;
}
err = tplg_build_integ(tplg);
if (err < 0) {
- SNDERR("error: failed to check topology integrity\n");
+ SNDERR("failed to check topology integrity");
return err;
}
err = tplg_write_data(tplg);
if (err < 0) {
- SNDERR("error: failed to write data %d\n", err);
+ SNDERR("failed to write data %d", err);
return err;
}
return 0;
fp = fopen(infile, "r");
if (fp == NULL) {
- SNDERR("error: could not open configuration file %s",
- infile);
+ SNDERR("could not open configuration file %s", infile);
return -errno;
}
err = snd_input_stdio_attach(&in, fp, 1);
if (err < 0) {
fclose(fp);
- SNDERR("error: could not attach stdio %s", infile);
+ SNDERR("could not attach stdio %s", infile);
return err;
}
case SND_TPLG_TYPE_CC:
return tplg_add_link_object(tplg, t);
default:
- SNDERR("error: invalid object type %d\n", t->type);
+ SNDERR("invalid object type %d", t->type);
return -EINVAL;
};
}
fd = open(outfile, O_RDWR | O_CREAT | O_TRUNC, S_IRUSR | S_IWUSR);
if (fd < 0) {
- SNDERR("error: failed to open %s err %d\n", outfile, -errno);
+ SNDERR("failed to open %s err %d", outfile, -errno);
return -errno;
}
r = write(fd, tplg->bin, tplg->bin_size);
close(fd);
if (r < 0) {
err = -errno;
- SNDERR("error: write error: %s\n", strerror(errno));
+ SNDERR("write error: %s", strerror(errno));
return err;
}
if ((size_t)r != tplg->bin_size) {
- SNDERR("error: partial write (%zd != %zd)\n", r, tplg->bin_size);
+ SNDERR("partial write (%zd != %zd)", r, tplg->bin_size);
return -EIO;
}
return 0;
snd_tplg_t *tplg;
if (!is_little_endian()) {
- SNDERR("error: cannot support big-endian machines\n");
+ SNDERR("cannot support big-endian machines");
return NULL;
}
return err;
}
if (!ref->elem) {
- SNDERR("error: cannot find '%s' referenced by"
- " PCM '%s'\n", ref->id, elem->id);
+ SNDERR("cannot find '%s' referenced by"
+ " PCM '%s'", ref->id, elem->id);
return -EINVAL;
}
}
elem = list_entry(pos, struct tplg_elem, list);
if (elem->type != type) {
- SNDERR("error: invalid elem '%s'\n", elem->id);
+ SNDERR("invalid elem '%s'", elem->id);
return -EINVAL;
}
elem = list_entry(pos, struct tplg_elem, list);
if (elem->type != type) {
- SNDERR("error: invalid elem '%s'\n", elem->id);
+ SNDERR("invalid elem '%s'", elem->id);
return -EINVAL;
}
ref->elem = tplg_elem_lookup(&tplg->hw_cfg_list,
ref->id, SND_TPLG_TYPE_HW_CONFIG, elem->index);
if (!ref->elem) {
- SNDERR("error: cannot find HW config '%s'"
- " referenced by link '%s'\n",
+ SNDERR("cannot find HW config '%s'"
+ " referenced by link '%s'",
ref->id, elem->id);
return -EINVAL;
}
while ((s != NULL) && (i < SND_SOC_TPLG_MAX_FORMATS)) {
format = snd_pcm_format_value(s);
if (format == SND_PCM_FORMAT_UNKNOWN) {
- SNDERR("error: unsupported stream format %s\n", s);
+ SNDERR("unsupported stream format %s", s);
return -EINVAL;
}
rate = get_rate_value(s);
if (rate == SND_PCM_RATE_UNKNOWN) {
- SNDERR("error: unsupported stream rate %s\n", s);
+ SNDERR("unsupported stream rate %s", s);
return -EINVAL;
}
if (strcmp(id, "id") == 0) {
if (tplg_get_unsigned(n, &pcm->dai_id, 0)) {
- SNDERR("error: invalid fe dai ID\n");
+ SNDERR("invalid fe dai ID");
return -EINVAL;
}
if (strcasecmp(audio_hw_formats[i].name, val) == 0)
return audio_hw_formats[i].type;
- SNDERR("error: invalid audio HW format %s\n", val);
+ SNDERR("invalid audio HW format %s", val);
return -EINVAL;
}
/* For backwards capability,
* "master" == "codec is slave"
*/
- SNDERR("warning: deprecated bclk value '%s'\n",
- val);
+ SNDERR("deprecated bclk value '%s'", val);
hw_cfg->bclk_master = SND_SOC_TPLG_BCLK_CS;
} else if (!strcmp(val, "codec_slave")) {
/* For backwards capability,
* "master" == "codec is slave"
*/
- SNDERR("warning: deprecated fsync value '%s'\n",
- val);
+ SNDERR("deprecated fsync value '%s'", val);
hw_cfg->fsync_master = SND_SOC_TPLG_FSYNC_CS;
} else if (!strcmp(val, "codec_slave")) {
/* For backwards capability,
* "master" == "for codec, mclk is input"
*/
- SNDERR("warning: deprecated mclk value '%s'\n",
- val);
+ SNDERR("deprecated mclk value '%s'", val);
hw_cfg->mclk_direction = SND_SOC_TPLG_MCLK_CI;
} else if (!strcmp(val, "codec_mclk_in")) {
n = snd_config_iterator_entry(i);
if (j == SND_SOC_TPLG_NUM_TEXTS) {
- tplg_dbg("error: text string number exceeds %d\n", j);
+ tplg_dbg("text string number exceeds %d\n", j);
return -ENOMEM;
}