vserver 1.9.3
[linux-2.6.git] / sound / core / init.c
index 9c3df61..1ff7667 100644 (file)
@@ -73,7 +73,7 @@ snd_card_t *snd_card_new(int idx, const char *xid,
 
        if (extra_size < 0)
                extra_size = 0;
-       card = (snd_card_t *) snd_kcalloc(sizeof(snd_card_t) + extra_size, GFP_KERNEL);
+       card = kcalloc(1, sizeof(*card) + extra_size, GFP_KERNEL);
        if (card == NULL)
                return NULL;
        if (xid) {
@@ -800,6 +800,8 @@ int snd_card_pci_resume(struct pci_dev *dev)
                return 0;
        if (card->power_state == SNDRV_CTL_POWER_D0)
                return 0;
+       /* restore the PCI config space */
+       pci_restore_state(dev, dev->saved_config_space);
        /* FIXME: correct state value? */
        return card->pm_resume(card, 0);
 }