mirror of https://github.com/thesofproject/sof.git
sof-ctl: Add support for read-only, write-only and read-write kcontrol
This patch checks for the access type of kcontrol and returns error only when the access type is not read or write. Signed-off-by: Dharageswari R <dharageswari.r@intel.com>
This commit is contained in:
parent
d77655059e
commit
49d432dded
|
@ -355,12 +355,9 @@ static int ctl_setup(struct ctl_data *ctl_data)
|
|||
read = snd_ctl_elem_info_is_tlv_readable(ctl_data->info);
|
||||
write = snd_ctl_elem_info_is_tlv_writable(ctl_data->info);
|
||||
type = snd_ctl_elem_info_get_type(ctl_data->info);
|
||||
if (!read) {
|
||||
fprintf(stderr, "Error: No read capability.\n");
|
||||
goto value_free;
|
||||
}
|
||||
if (!write) {
|
||||
fprintf(stderr, "Error: No write capability.\n");
|
||||
|
||||
if (!read && !write) {
|
||||
fprintf(stderr, "Error: Not a read/write control\n");
|
||||
goto value_free;
|
||||
}
|
||||
if (type != SND_CTL_ELEM_TYPE_BYTES) {
|
||||
|
|
Loading…
Reference in New Issue