--- zzzz-none-000/linux-3.10.107/sound/ppc/snd_ps3.c 2017-06-27 09:49:32.000000000 +0000 +++ scorpion-7490-727/linux-3.10.107/sound/ppc/snd_ps3.c 2021-02-04 17:41:59.000000000 +0000 @@ -933,8 +933,10 @@ int i, ret; u64 lpar_addr, lpar_size; - BUG_ON(!firmware_has_feature(FW_FEATURE_PS3_LV1)); - BUG_ON(dev->match_id != PS3_MATCH_ID_SOUND); + if (WARN_ON(!firmware_has_feature(FW_FEATURE_PS3_LV1))) + return -ENODEV; + if (WARN_ON(dev->match_id != PS3_MATCH_ID_SOUND)) + return -ENODEV; the_card.ps3_dev = dev; @@ -982,7 +984,8 @@ } /* create card instance */ - ret = snd_card_create(index, id, THIS_MODULE, 0, &the_card.card); + ret = snd_card_new(&dev->core, index, id, THIS_MODULE, + 0, &the_card.card); if (ret < 0) goto clean_irq; @@ -1041,7 +1044,7 @@ if (!the_card.null_buffer_start_vaddr) { pr_info("%s: nullbuffer alloc failed\n", __func__); ret = -ENOMEM; - goto clean_preallocate; + goto clean_card; } pr_debug("%s: null vaddr=%p dma=%#llx\n", __func__, the_card.null_buffer_start_vaddr, @@ -1050,7 +1053,6 @@ snd_ps3_init_avsetting(&the_card); /* register the card */ - snd_card_set_dev(the_card.card, &dev->core); ret = snd_card_register(the_card.card); if (ret < 0) goto clean_dma_map; @@ -1064,8 +1066,6 @@ PAGE_SIZE, the_card.null_buffer_start_vaddr, the_card.null_buffer_start_dma_addr); -clean_preallocate: - snd_pcm_lib_preallocate_free_for_all(the_card.pcm); clean_card: snd_card_free(the_card.card); clean_irq: