]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
Merge branch 'fix/hda' into topic/hda
authorTakashi Iwai <tiwai@suse.de>
Fri, 20 Feb 2009 15:06:47 +0000 (16:06 +0100)
committerTakashi Iwai <tiwai@suse.de>
Fri, 20 Feb 2009 15:06:47 +0000 (16:06 +0100)
sound/pci/hda/hda_hwdep.c

index 482fb0304ca91fc4a7735408393ec68b888bcefc..4ae51dcb81af861450e37d2219c76b6027746764 100644 (file)
@@ -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;
 }