X-Git-Url: http://git.cascardo.info/?a=blobdiff_plain;f=sound%2Fsoc%2Fau1x%2Fpsc-ac97.c;h=6a9516cbe42453f6e7d67d85ced5dee5e76f36fb;hb=f0fba2ad1b6b53d5360125c41953b7afcd6deff0;hp=a61ccd2d505f010fd9720a29c8ce318e7d27819e;hpb=df2071bd081408318d659cd14a9cf6ff23d874c9;p=cascardo%2Flinux.git diff --git a/sound/soc/au1x/psc-ac97.c b/sound/soc/au1x/psc-ac97.c index a61ccd2d505f..6a9516cbe424 100644 --- a/sound/soc/au1x/psc-ac97.c +++ b/sound/soc/au1x/psc-ac97.c @@ -315,27 +315,19 @@ static int au1xpsc_ac97_trigger(struct snd_pcm_substream *substream, return ret; } -static int au1xpsc_ac97_probe(struct platform_device *pdev, - struct snd_soc_dai *dai) +static int au1xpsc_ac97_probe(struct snd_soc_dai *dai) { return au1xpsc_ac97_workdata ? 0 : -ENODEV; } -static void au1xpsc_ac97_remove(struct platform_device *pdev, - struct snd_soc_dai *dai) -{ -} - static struct snd_soc_dai_ops au1xpsc_ac97_dai_ops = { .trigger = au1xpsc_ac97_trigger, .hw_params = au1xpsc_ac97_hw_params, }; -struct snd_soc_dai au1xpsc_ac97_dai = { - .name = "au1xpsc_ac97", +struct snd_soc_dai_driver au1xpsc_ac97_dai = { .ac97_control = 1, .probe = au1xpsc_ac97_probe, - .remove = au1xpsc_ac97_remove, .playback = { .rates = AC97_RATES, .formats = AC97_FMTS, @@ -375,12 +367,10 @@ static int __devinit au1xpsc_ac97_drvprobe(struct platform_device *pdev) } ret = -EBUSY; - wd->ioarea = request_mem_region(r->start, r->end - r->start + 1, - "au1xpsc_ac97"); - if (!wd->ioarea) + if (!request_mem_region(r->start, resource_size(r), pdev->name)) goto out0; - wd->mmio = ioremap(r->start, 0xffff); + wd->mmio = ioremap(r->start, resource_size(r)); if (!wd->mmio) goto out1; @@ -397,7 +387,7 @@ static int __devinit au1xpsc_ac97_drvprobe(struct platform_device *pdev) au_writel(PSC_SEL_PS_AC97MODE | sel, PSC_SEL(wd)); au_sync(); - ret = snd_soc_register_dai(&au1xpsc_ac97_dai); + ret = snd_soc_register_dai(&pdev->dev, &au1xpsc_ac97_dai); if (ret) goto out1; @@ -408,10 +398,9 @@ static int __devinit au1xpsc_ac97_drvprobe(struct platform_device *pdev) return 0; } - snd_soc_unregister_dai(&au1xpsc_ac97_dai); + snd_soc_unregister_dai(&pdev->dev); out1: - release_resource(wd->ioarea); - kfree(wd->ioarea); + release_mem_region(r->start, resource_size(r)); out0: kfree(wd); return ret; @@ -420,11 +409,12 @@ out0: static int __devexit au1xpsc_ac97_drvremove(struct platform_device *pdev) { struct au1xpsc_audio_data *wd = platform_get_drvdata(pdev); + struct resource *r = platform_get_resource(pdev, IORESOURCE_MEM, 0); if (wd->dmapd) au1xpsc_pcm_destroy(wd->dmapd); - snd_soc_unregister_dai(&au1xpsc_ac97_dai); + snd_soc_unregister_dai(&pdev->dev); /* disable PSC completely */ au_writel(0, AC97_CFG(wd)); @@ -433,8 +423,7 @@ static int __devexit au1xpsc_ac97_drvremove(struct platform_device *pdev) au_sync(); iounmap(wd->mmio); - release_resource(wd->ioarea); - kfree(wd->ioarea); + release_mem_region(r->start, resource_size(r)); kfree(wd); au1xpsc_ac97_workdata = NULL; /* MDEV */ @@ -488,7 +477,7 @@ static struct dev_pm_ops au1xpscac97_pmops = { static struct platform_driver au1xpsc_ac97_driver = { .driver = { - .name = "au1xpsc_ac97", + .name = "au1xpsc-ac97", .owner = THIS_MODULE, .pm = AU1XPSCAC97_PMOPS, },