diff options
author | Takashi Iwai <tiwai@suse.de> | 2009-02-20 10:06:47 -0500 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2009-02-20 10:06:47 -0500 |
commit | d2f57cd54a602c979e571aa337b206c88609876d (patch) | |
tree | a17c840fe174bf36cdd39e4dbc3fc664aad0041d /sound/pci | |
parent | 7e0e44d430281d398769f1d7864e161203252760 (diff) | |
parent | 55290e1932102f57ea17e7cff895914c2dbdb4c4 (diff) |
Merge branch 'fix/hda' into topic/hda
Diffstat (limited to 'sound/pci')
-rw-r--r-- | sound/pci/hda/hda_hwdep.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/sound/pci/hda/hda_hwdep.c b/sound/pci/hda/hda_hwdep.c index 482fb0304ca9..4ae51dcb81af 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, | |||
277 | { | 277 | { |
278 | struct snd_hwdep *hwdep = dev_get_drvdata(dev); | 278 | struct snd_hwdep *hwdep = dev_get_drvdata(dev); |
279 | struct hda_codec *codec = hwdep->private_data; | 279 | struct hda_codec *codec = hwdep->private_data; |
280 | char *p; | 280 | struct hda_verb *v; |
281 | struct hda_verb verb, *v; | 281 | int nid, verb, param; |
282 | 282 | ||
283 | verb.nid = simple_strtoul(buf, &p, 0); | 283 | if (sscanf(buf, "%i %i %i", &nid, &verb, ¶m) != 3) |
284 | verb.verb = simple_strtoul(p, &p, 0); | 284 | return -EINVAL; |
285 | verb.param = simple_strtoul(p, &p, 0); | 285 | if (!nid || !verb) |
286 | if (!verb.nid || !verb.verb || !verb.param) | ||
287 | return -EINVAL; | 286 | return -EINVAL; |
288 | v = snd_array_new(&codec->init_verbs); | 287 | v = snd_array_new(&codec->init_verbs); |
289 | if (!v) | 288 | if (!v) |
290 | return -ENOMEM; | 289 | return -ENOMEM; |
291 | *v = verb; | 290 | v->nid = nid; |
291 | v->verb = verb; | ||
292 | v->param = param; | ||
292 | return count; | 293 | return count; |
293 | } | 294 | } |
294 | 295 | ||