--- device.c.orig 2011-02-17 19:42:06.000000000 -0800 +++ device.c 2011-02-17 21:16:55.442483443 -0800 @@ -1660,11 +1660,19 @@ /* let the kernel option override custom id */ strncpy(card_id,id[idx],sizeof(card_id)-1); } +#if ( LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,31) ) + err = snd_card_create(index[idx], card_id/*id[idx]*/, THIS_MODULE, 0, &card); + if (err < 0) { + snd_printk(KERN_WARNING "snd_hdj_chip_create(): cannot create card instance %d\n", idx); + return err; + } +#else card = snd_card_new(index[idx], card_id/*id[idx]*/, THIS_MODULE, 0); if (card == NULL) { snd_printk(KERN_WARNING "snd_hdj_chip_create(): cannot create card instance %d\n", idx); return -ENOMEM; } +#endif /* save the index, so people who have the card can reference the chip */ card->private_data = (void*)(unsigned long)idx;