[alsa-devel] [PATCH v2] alsa/Au1xxx-PSC: use resource_size

Manuel Lauss manuel.lauss at googlemail.com
Fri May 28 08:53:32 CEST 2010


On Fri, May 28, 2010 at 8:31 AM, Wan ZongShun <mcuos.com at gmail.com> wrote:
> Dear Manuel,
>
> For insteading of using the 'platform_get_resource' in remove function,
> I think it better to put 'struct resource *r' into 'wd' structure.
>
> I have re-organized the patch and submit to you.
>
> Of course, I must get your approval if I do above. :)
>
> Signed-off-by:Wan ZongShun<mcuos.com at gmail.com>

The patch doesn't apply at all to latest linus-git.

How about something much simpler, like this for example:

diff --git a/sound/soc/au1x/psc-ac97.c b/sound/soc/au1x/psc-ac97.c
index a61ccd2..a18e924 100644
--- a/sound/soc/au1x/psc-ac97.c
+++ b/sound/soc/au1x/psc-ac97.c
@@ -375,7 +375,7 @@ static int __devinit au1xpsc_ac97_drvprobe(struct
platform_device *pdev)
        }

        ret = -EBUSY;
-       wd->ioarea = request_mem_region(r->start, r->end - r->start + 1,
+       wd->ioarea = request_mem_region(r->start, resource_size(r),
                                        "au1xpsc_ac97");
        if (!wd->ioarea)
                goto out0;
diff --git a/sound/soc/au1x/psc-i2s.c b/sound/soc/au1x/psc-i2s.c
index 495be6e..76e848f 100644
--- a/sound/soc/au1x/psc-i2s.c
+++ b/sound/soc/au1x/psc-i2s.c
@@ -321,7 +321,7 @@ static int __init au1xpsc_i2s_drvprobe(struct
platform_device *pdev)
        }

        ret = -EBUSY;
-       wd->ioarea = request_mem_region(r->start, r->end - r->start + 1,
+       wd->ioarea = request_mem_region(r->start, resource_size(r),
                                        "au1xpsc_i2s");
        if (!wd->ioarea)
                goto out0;

Manuel


More information about the Alsa-devel mailing list