Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 361332
b: refs/heads/master
c: b5f82b1
h: refs/heads/master
v: v3
  • Loading branch information
Takashi Iwai committed Mar 12, 2013
1 parent fb272e9 commit d2945ca
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 11 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 281a6ac0f54052c81bbee156914459ba5a08f924
refs/heads/master: b5f82b1044daef74059f454353a2ee97acbbe620
24 changes: 14 additions & 10 deletions trunk/sound/pci/hda/hda_codec.c
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,7 @@ static unsigned int get_num_conns(struct hda_codec *codec, hda_nid_t nid)

int snd_hda_get_num_raw_conns(struct hda_codec *codec, hda_nid_t nid)
{
return get_num_conns(codec, nid) & AC_CLIST_LENGTH;
return snd_hda_get_raw_connections(codec, nid, NULL, 0);
}

/**
Expand All @@ -517,9 +517,6 @@ int snd_hda_get_raw_connections(struct hda_codec *codec, hda_nid_t nid,
hda_nid_t prev_nid;
int null_count = 0;

if (snd_BUG_ON(!conn_list || max_conns <= 0))
return -EINVAL;

parm = get_num_conns(codec, nid);
if (!parm)
return 0;
Expand All @@ -545,7 +542,8 @@ int snd_hda_get_raw_connections(struct hda_codec *codec, hda_nid_t nid,
AC_VERB_GET_CONNECT_LIST, 0);
if (parm == -1 && codec->bus->rirb_error)
return -EIO;
conn_list[0] = parm & mask;
if (conn_list)
conn_list[0] = parm & mask;
return 1;
}

Expand Down Expand Up @@ -580,14 +578,20 @@ int snd_hda_get_raw_connections(struct hda_codec *codec, hda_nid_t nid,
continue;
}
for (n = prev_nid + 1; n <= val; n++) {
if (conn_list) {
if (conns >= max_conns)
return -ENOSPC;
conn_list[conns] = n;
}
conns++;
}
} else {
if (conn_list) {
if (conns >= max_conns)
return -ENOSPC;
conn_list[conns++] = n;
conn_list[conns] = val;
}
} else {
if (conns >= max_conns)
return -ENOSPC;
conn_list[conns++] = val;
conns++;
}
prev_nid = val;
}
Expand Down

0 comments on commit d2945ca

Please sign in to comment.