From patchwork Tue Mar 3 17:39:52 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Meerwald-Stadler X-Patchwork-Id: 5924651 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 92A24BF440 for ; Tue, 3 Mar 2015 17:40:33 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C6CEE2042C for ; Tue, 3 Mar 2015 17:40:32 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id DE8892042B for ; Tue, 3 Mar 2015 17:40:31 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 9CDD02619EA; Tue, 3 Mar 2015 18:40:25 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id CD342261736; Tue, 3 Mar 2015 18:40:17 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 1D7AC2617AB; Tue, 3 Mar 2015 18:40:16 +0100 (CET) Received: from pmeerw.net (ns.pmeerw.net [84.19.176.92]) by alsa0.perex.cz (Postfix) with ESMTP id 38ECE261735 for ; Tue, 3 Mar 2015 18:40:09 +0100 (CET) Received: from localhost.localdomain (unknown [195.70.114.118]) (using TLSv1.1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: pmeerw@pmeerw.net) by pmeerw.net (Postfix) with ESMTPSA id 49C4355C016E; Tue, 3 Mar 2015 18:40:08 +0100 (CET) From: Peter Meerwald To: alsa-devel@alsa-project.org Date: Tue, 3 Mar 2015 18:39:52 +0100 Message-Id: <1425404392-22598-1-git-send-email-pmeerw@pmeerw.net> X-Mailer: git-send-email 1.7.9.5 Cc: Peter Meerwald Subject: [alsa-devel] [PATCH] amixer: Don't set only the first item in sset_enum() X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP From: Peter Meerwald Signed-off-by: Peter Meerwald --- amixer/amixer.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/amixer/amixer.c b/amixer/amixer.c index ed60e7c..36c92eb 100644 --- a/amixer/amixer.c +++ b/amixer/amixer.c @@ -1278,7 +1278,7 @@ static int get_enum_item_index(snd_mixer_elem_t *elem, char **ptrp) static int sset_enum(snd_mixer_elem_t *elem, unsigned int argc, char **argv) { - unsigned int idx, chn = 0; + unsigned int idx, item = 0; int check_flag = ignore_error ? 0 : -1; for (idx = 1; idx < argc; idx++) { @@ -1287,7 +1287,7 @@ static int sset_enum(snd_mixer_elem_t *elem, unsigned int argc, char **argv) int ival = get_enum_item_index(elem, &ptr); if (ival < 0) return check_flag; - if (snd_mixer_selem_set_enum_item(elem, chn, ival) >= 0) + if (snd_mixer_selem_set_enum_item(elem, item++, ival) >= 0) check_flag = 1; /* skip separators */ while (*ptr == ',' || isspace(*ptr))