--- zzzz-none-000/linux-3.10.107/sound/isa/opl3sa2.c 2017-06-27 09:49:32.000000000 +0000 +++ scorpion-7490-727/linux-3.10.107/sound/isa/opl3sa2.c 2021-02-04 17:41:59.000000000 +0000 @@ -26,6 +26,7 @@ #include #include #include +#include #include #include #include @@ -33,8 +34,6 @@ #include #include -#include - MODULE_AUTHOR("Jaroslav Kysela "); MODULE_DESCRIPTION("Yamaha OPL3SA2+"); MODULE_LICENSE("GPL"); @@ -627,14 +626,15 @@ release_and_free_resource(chip->res_port); } -static int snd_opl3sa2_card_new(int dev, struct snd_card **cardp) +static int snd_opl3sa2_card_new(struct device *pdev, int dev, + struct snd_card **cardp) { struct snd_card *card; struct snd_opl3sa2 *chip; int err; - err = snd_card_create(index[dev], id[dev], THIS_MODULE, - sizeof(struct snd_opl3sa2), &card); + err = snd_card_new(pdev, index[dev], id[dev], THIS_MODULE, + sizeof(struct snd_opl3sa2), &card); if (err < 0) return err; strcpy(card->driver, "OPL3SA2"); @@ -683,7 +683,7 @@ return err; } chip->wss = wss; - err = snd_wss_pcm(wss, 0, NULL); + err = snd_wss_pcm(wss, 0); if (err < 0) return err; err = snd_wss_mixer(wss); @@ -692,7 +692,7 @@ err = snd_opl3sa2_mixer(card); if (err < 0) return err; - err = snd_wss_timer(wss, 0, NULL); + err = snd_wss_timer(wss, 0); if (err < 0) return err; if (fm_port[dev] >= 0x340 && fm_port[dev] < 0x400) { @@ -737,14 +737,13 @@ if (dev >= SNDRV_CARDS) return -ENODEV; - err = snd_opl3sa2_card_new(dev, &card); + err = snd_opl3sa2_card_new(&pdev->dev, dev, &card); if (err < 0) return err; if ((err = snd_opl3sa2_pnp(dev, card->private_data, pdev)) < 0) { snd_card_free(card); return err; } - snd_card_set_dev(card, &pdev->dev); if ((err = snd_opl3sa2_probe(card, dev)) < 0) { snd_card_free(card); return err; @@ -757,7 +756,6 @@ static void snd_opl3sa2_pnp_remove(struct pnp_dev *pdev) { snd_card_free(pnp_get_drvdata(pdev)); - pnp_set_drvdata(pdev, NULL); } #ifdef CONFIG_PM @@ -803,14 +801,13 @@ if (dev >= SNDRV_CARDS) return -ENODEV; - err = snd_opl3sa2_card_new(dev, &card); + err = snd_opl3sa2_card_new(&pdev->dev, dev, &card); if (err < 0) return err; if ((err = snd_opl3sa2_pnp(dev, card->private_data, pdev)) < 0) { snd_card_free(card); return err; } - snd_card_set_dev(card, &pdev->dev); if ((err = snd_opl3sa2_probe(card, dev)) < 0) { snd_card_free(card); return err; @@ -884,10 +881,9 @@ struct snd_card *card; int err; - err = snd_opl3sa2_card_new(dev, &card); + err = snd_opl3sa2_card_new(pdev, dev, &card); if (err < 0) return err; - snd_card_set_dev(card, pdev); if ((err = snd_opl3sa2_probe(card, dev)) < 0) { snd_card_free(card); return err; @@ -900,7 +896,6 @@ unsigned int dev) { snd_card_free(dev_get_drvdata(devptr)); - dev_set_drvdata(devptr, NULL); return 0; }