diff options
Diffstat (limited to 'sound/soc/au1x/psc-ac97.c')
-rw-r--r-- | sound/soc/au1x/psc-ac97.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/sound/soc/au1x/psc-ac97.c b/sound/soc/au1x/psc-ac97.c index a61ccd2d505f..d14a5a91a465 100644 --- a/sound/soc/au1x/psc-ac97.c +++ b/sound/soc/au1x/psc-ac97.c | |||
@@ -375,12 +375,10 @@ static int __devinit au1xpsc_ac97_drvprobe(struct platform_device *pdev) | |||
375 | } | 375 | } |
376 | 376 | ||
377 | ret = -EBUSY; | 377 | ret = -EBUSY; |
378 | wd->ioarea = request_mem_region(r->start, r->end - r->start + 1, | 378 | if (!request_mem_region(r->start, resource_size(r), pdev->name)) |
379 | "au1xpsc_ac97"); | ||
380 | if (!wd->ioarea) | ||
381 | goto out0; | 379 | goto out0; |
382 | 380 | ||
383 | wd->mmio = ioremap(r->start, 0xffff); | 381 | wd->mmio = ioremap(r->start, resource_size(r)); |
384 | if (!wd->mmio) | 382 | if (!wd->mmio) |
385 | goto out1; | 383 | goto out1; |
386 | 384 | ||
@@ -410,8 +408,7 @@ static int __devinit au1xpsc_ac97_drvprobe(struct platform_device *pdev) | |||
410 | 408 | ||
411 | snd_soc_unregister_dai(&au1xpsc_ac97_dai); | 409 | snd_soc_unregister_dai(&au1xpsc_ac97_dai); |
412 | out1: | 410 | out1: |
413 | release_resource(wd->ioarea); | 411 | release_mem_region(r->start, resource_size(r)); |
414 | kfree(wd->ioarea); | ||
415 | out0: | 412 | out0: |
416 | kfree(wd); | 413 | kfree(wd); |
417 | return ret; | 414 | return ret; |
@@ -420,6 +417,7 @@ out0: | |||
420 | static int __devexit au1xpsc_ac97_drvremove(struct platform_device *pdev) | 417 | static int __devexit au1xpsc_ac97_drvremove(struct platform_device *pdev) |
421 | { | 418 | { |
422 | struct au1xpsc_audio_data *wd = platform_get_drvdata(pdev); | 419 | struct au1xpsc_audio_data *wd = platform_get_drvdata(pdev); |
420 | struct resource *r = platform_get_resource(pdev, IORESOURCE_MEM, 0); | ||
423 | 421 | ||
424 | if (wd->dmapd) | 422 | if (wd->dmapd) |
425 | au1xpsc_pcm_destroy(wd->dmapd); | 423 | au1xpsc_pcm_destroy(wd->dmapd); |
@@ -433,8 +431,7 @@ static int __devexit au1xpsc_ac97_drvremove(struct platform_device *pdev) | |||
433 | au_sync(); | 431 | au_sync(); |
434 | 432 | ||
435 | iounmap(wd->mmio); | 433 | iounmap(wd->mmio); |
436 | release_resource(wd->ioarea); | 434 | release_mem_region(r->start, resource_size(r)); |
437 | kfree(wd->ioarea); | ||
438 | kfree(wd); | 435 | kfree(wd); |
439 | 436 | ||
440 | au1xpsc_ac97_workdata = NULL; /* MDEV */ | 437 | au1xpsc_ac97_workdata = NULL; /* MDEV */ |