Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 178637
b: refs/heads/master
c: 74c75c1
h: refs/heads/master
i:
  178635: 6134f3f
v: v3
  • Loading branch information
Henrique de Moraes Holschuh authored and Len Brown committed Dec 27, 2009
1 parent 7d16e94 commit 5371ca0
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 14 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: ead510cebcdf41c92fce2a909f342255b028a33d
refs/heads/master: 74c75c1848b618f6717c1be887ad539ffac2e96d
31 changes: 18 additions & 13 deletions trunk/drivers/platform/x86/thinkpad_acpi.c
Original file line number Diff line number Diff line change
Expand Up @@ -6705,10 +6705,11 @@ static int __init volume_create_alsa_mixer(void)

rc = snd_card_create(alsa_index, alsa_id, THIS_MODULE,
sizeof(struct tpacpi_alsa_data), &card);
if (rc < 0)
return rc;
if (!card)
return -ENOMEM;
if (rc < 0 || !card) {
printk(TPACPI_ERR
"Failed to create ALSA card structures: %d\n", rc);
return 1;
}

BUG_ON(!card->private_data);
data = card->private_data;
Expand Down Expand Up @@ -6741,31 +6742,35 @@ static int __init volume_create_alsa_mixer(void)
rc = snd_ctl_add(card, ctl_vol);
if (rc < 0) {
printk(TPACPI_ERR
"Failed to create ALSA volume control\n");
goto err_out;
"Failed to create ALSA volume control: %d\n",
rc);
goto err_exit;
}
data->ctl_vol_id = &ctl_vol->id;
}

ctl_mute = snd_ctl_new1(&volume_alsa_control_mute, NULL);
rc = snd_ctl_add(card, ctl_mute);
if (rc < 0) {
printk(TPACPI_ERR "Failed to create ALSA mute control\n");
goto err_out;
printk(TPACPI_ERR "Failed to create ALSA mute control: %d\n",
rc);
goto err_exit;
}
data->ctl_mute_id = &ctl_mute->id;

snd_card_set_dev(card, &tpacpi_pdev->dev);
rc = snd_card_register(card);

err_out:
if (rc < 0) {
snd_card_free(card);
card = NULL;
printk(TPACPI_ERR "Failed to register ALSA card: %d\n", rc);
goto err_exit;
}

alsa_card = card;
return rc;
return 0;

err_exit:
snd_card_free(card);
return 1;
}

#define TPACPI_VOL_Q_MUTEONLY 0x0001 /* Mute-only control available */
Expand Down

0 comments on commit 5371ca0

Please sign in to comment.