logo       

[PATCH] [UBUNTU:sound/pci/hda/] Fix error checks in HDA Realtek and Analog : msg#00032

Subject: [PATCH] [UBUNTU:sound/pci/hda/] Fix error checks in HDA Realtek and Analog Devices codecs for setting channel mode
From 9320d5ed1e6d2f4e3b038fce16d2d752a80092a0 Mon Sep 17 00:00:00 2001
From: Daniel T. Chen <crimsun@xxxxxxxxxxxxxxxxxxx>
Date: Tue, 10 Oct 2006 15:20:28 -0400
Subject: [PATCH] [UBUNTU:sound/pci/hda/] Fix error checks in HDA Realtek and 
Analog Devices codecs for setting channel mode

UpstreamStatus: Added in upstream alsa-kernel hg changeset:
                fb8c2e7fc5e6 
[http://hg-mirror.alsa-project.org/alsa-kernel?cmd=changeset;node=fb8c2e7fc5e60ddc495f79f331e72e638c81d74a;style=raw]

This patch from Takashi Iwai fixes incorrect error checks in the HDA
Realtek and Analog Devices codecs for setting the channel mode.

This commit is applicable to both Dapper and Edgy linux-source.

Signed-off-by: Daniel T Chen <crimsun@xxxxxxxxxx>
---
 sound/pci/hda/patch_analog.c  |    2 +-
 sound/pci/hda/patch_realtek.c |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/sound/pci/hda/patch_analog.c b/sound/pci/hda/patch_analog.c
index 074998e..5a9426e 100644
--- a/sound/pci/hda/patch_analog.c
+++ b/sound/pci/hda/patch_analog.c
@@ -1622,7 +1622,7 @@ static int ad198x_ch_mode_put(snd_kcontr
        int err = snd_hda_ch_mode_put(codec, ucontrol, spec->channel_mode,
                                      spec->num_channel_mode,
                                      &spec->multiout.max_channels);
-       if (! err && spec->need_dac_fix)
+       if (err >= 0 && spec->need_dac_fix)
                spec->multiout.num_dacs = spec->multiout.max_channels / 2;
        return err;
 }
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index 8291e92..ddd4ff0 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -261,7 +261,7 @@ static int alc_ch_mode_put(snd_kcontrol_
        int err = snd_hda_ch_mode_put(codec, ucontrol, spec->channel_mode,
                                      spec->num_channel_mode,
                                      &spec->multiout.max_channels);
-       if (! err && spec->need_dac_fix)
+       if (err >= 0 && spec->need_dac_fix)
                spec->multiout.num_dacs = spec->multiout.max_channels / 2;
        return err;
 }
-- 
1.4.1

-- 
Daniel T. Chen            crimsun@xxxxxxxxxx
GPG key:  0xC88ABDA3

Attachment: pgpfW6I1tzBiK.pgp
Description: PGP signature


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
audio.irate.dev...    yellowdog.gener...    ietf.ips/2002-0...    xfree86.fonts/2...    busybox/2003-07...    emacs.jdee/2004...    linux.mandrake....    hardware.microc...    user-groups.lin...    science.analysi...    version-control...    db.filemaker.de...    cluster.openmos...    mail.eyebrowse....    text.xml.xerces...    kde.devel.kwrit...    finance.moneyda...    gcc.regression/...    network.routing...    os.freebsd.deve...    recreation.radi...    qnx.openqnx.dev...    python.xml/2002...   
Home | blog view | USPTO Patent Archive | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe