Skip to content

Commit

Permalink
LIBINI: Handle "hardwaregain", when the value has a trailing "dB"
Browse files Browse the repository at this point in the history
        (like it does from the kernel).

Signed-off-by: Robin Getz <[email protected]>
  • Loading branch information
rgetz authored and dNechita committed Apr 23, 2014
1 parent fbfdbcb commit 72d1605
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion libini.c
Original file line number Diff line number Diff line change
Expand Up @@ -189,8 +189,13 @@ static int libini_restore_handler(void *user, const char* section,
break;
plugin->handle_item(plugin, name, value);
break;
} else
} else {
if (strstr(elems[1], "hardwaregain") && strstr(value, " dB")) {
val_str = strstr(value, " dB");
*val_str = 0;
}
ret = !write_devattr(elems[1], value);
}
break;
case 2:
/* log something, according to:
Expand Down

0 comments on commit 72d1605

Please sign in to comment.