[Cbe-oss-dev] [PATCH 06/15] ps3flash: Fix region align checks

Geert Uytterhoeven geert at linux-m68k.org
Tue Aug 2 06:29:23 EST 2011


On Mon, Aug 1, 2011 at 22:02, Andre Heider <a.heider at gmail.com> wrote:
> The region fields used by the align checks are set in
> ps3stor_setup(), so move those after that call.

Are you sure?
Aren't they set in
arch/powerpc/platforms/ps3/device-init.c:ps3_setup_storage_dev()?

> Signed-off-by: Andre Heider <a.heider at gmail.com>
> ---
>  drivers/char/ps3flash.c |   30 +++++++++++++++---------------
>  1 files changed, 15 insertions(+), 15 deletions(-)
>
> diff --git a/drivers/char/ps3flash.c b/drivers/char/ps3flash.c
> index 85c004a..69c734a 100644
> --- a/drivers/char/ps3flash.c
> +++ b/drivers/char/ps3flash.c
> @@ -360,21 +360,6 @@ static int __devinit ps3flash_probe(struct ps3_system_bus_device *_dev)
>        int error;
>        unsigned long tmp;
>
> -       tmp = dev->regions[dev->region_idx].start*dev->blk_size;
> -       if (tmp % FLASH_BLOCK_SIZE) {
> -               dev_err(&dev->sbd.core,
> -                       "%s:%u region start %lu is not aligned\n", __func__,
> -                       __LINE__, tmp);
> -               return -EINVAL;
> -       }
> -       tmp = dev->regions[dev->region_idx].size*dev->blk_size;
> -       if (tmp % FLASH_BLOCK_SIZE) {
> -               dev_err(&dev->sbd.core,
> -                       "%s:%u region size %lu is not aligned\n", __func__,
> -                       __LINE__, tmp);
> -               return -EINVAL;
> -       }
> -
>        /* use static buffer, kmalloc cannot allocate 256 KiB */
>        if (!ps3flash_bounce_buffer.address)
>                return -ENODEV;
> @@ -405,6 +390,21 @@ static int __devinit ps3flash_probe(struct ps3_system_bus_device *_dev)
>        if (error)
>                goto fail_free_priv;
>
> +       tmp = dev->regions[dev->region_idx].start*dev->blk_size;
> +       if (tmp % FLASH_BLOCK_SIZE) {
> +               dev_err(&dev->sbd.core,
> +                       "%s:%u region start %lu is not aligned\n", __func__,
> +                       __LINE__, tmp);
> +               return -EINVAL;
> +       }
> +       tmp = dev->regions[dev->region_idx].size*dev->blk_size;
> +       if (tmp % FLASH_BLOCK_SIZE) {
> +               dev_err(&dev->sbd.core,
> +                       "%s:%u region size %lu is not aligned\n", __func__,
> +                       __LINE__, tmp);
> +               return -EINVAL;
> +       }
> +
>        ps3flash_misc.parent = &dev->sbd.core;
>        error = misc_register(&ps3flash_misc);
>        if (error) {

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert at linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds


More information about the Linuxppc-dev mailing list