X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=sound%2Fcore%2Finit.c;h=1ff7667d7284250da47eeb541128ec6992aa5f2d;hb=c7b5ebbddf7bcd3651947760f423e3783bbe6573;hp=9c3df614ad7912f020ccae9e6cbda17c56edd082;hpb=a2c21200f1c81b08cb55e417b68150bba439b646;p=linux-2.6.git diff --git a/sound/core/init.c b/sound/core/init.c index 9c3df614a..1ff7667d7 100644 --- a/sound/core/init.c +++ b/sound/core/init.c @@ -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); }