aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2009-02-20 16:06:47 +0100
committerTakashi Iwai <tiwai@suse.de>2009-02-20 16:06:47 +0100
commitd2f57cd54a602c979e571aa337b206c88609876d (patch)
treea17c840fe174bf36cdd39e4dbc3fc664aad0041d
parent7e0e44d430281d398769f1d7864e161203252760 (diff)
parent55290e1932102f57ea17e7cff895914c2dbdb4c4 (diff)
downloadkernel_samsung_crespo-d2f57cd54a602c979e571aa337b206c88609876d.zip
kernel_samsung_crespo-d2f57cd54a602c979e571aa337b206c88609876d.tar.gz
kernel_samsung_crespo-d2f57cd54a602c979e571aa337b206c88609876d.tar.bz2
Merge branch 'fix/hda' into topic/hda
-rw-r--r--sound/pci/hda/hda_hwdep.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/sound/pci/hda/hda_hwdep.c b/sound/pci/hda/hda_hwdep.c
index 482fb03..4ae51dc 100644
--- a/sound/pci/hda/hda_hwdep.c
+++ b/sound/pci/hda/hda_hwdep.c
@@ -277,18 +277,19 @@ static ssize_t init_verbs_store(struct device *dev,
{
struct snd_hwdep *hwdep = dev_get_drvdata(dev);
struct hda_codec *codec = hwdep->private_data;
- char *p;
- struct hda_verb verb, *v;
+ struct hda_verb *v;
+ int nid, verb, param;
- verb.nid = simple_strtoul(buf, &p, 0);
- verb.verb = simple_strtoul(p, &p, 0);
- verb.param = simple_strtoul(p, &p, 0);
- if (!verb.nid || !verb.verb || !verb.param)
+ if (sscanf(buf, "%i %i %i", &nid, &verb, &param) != 3)
+ return -EINVAL;
+ if (!nid || !verb)
return -EINVAL;
v = snd_array_new(&codec->init_verbs);
if (!v)
return -ENOMEM;
- *v = verb;
+ v->nid = nid;
+ v->verb = verb;
+ v->param = param;
return count;
}