[PATCH 2/3] omap : nand : fix omap2 module reinsertion

Vimal Singh vimal.newwork at gmail.com
Fri Apr 29 11:54:47 EDT 2011


On Fri, Apr 29, 2011 at 4:01 PM, Bryan DE FARIA
<bdefaria at adeneo-embedded.com> wrote:
> When the module is removed, a reinsertion will fail with a -16 error.
>
> Signed-off-by: Bryan DE FARIA <bdefaria at adeneo-embedded.com>
> ---
>  drivers/mtd/nand/omap2.c |    1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/mtd/nand/omap2.c b/drivers/mtd/nand/omap2.c
> index da9a351..eab51da 100644
> --- a/drivers/mtd/nand/omap2.c
> +++ b/drivers/mtd/nand/omap2.c
> @@ -1138,6 +1138,7 @@ static int omap_nand_remove(struct platform_device *pdev)
>
>        /* Release NAND device, its internal structures and partitions */
>        nand_release(&info->mtd);
> +       release_mem_region(info->phys_base, NAND_IO_SIZE);

I think using 'release_resource' would be better here. And you should
better do this after below 'iounmap' is done.

>        iounmap(info->nand.IO_ADDR_R);
>        kfree(&info->mtd);
>        return 0;
> --

-- 
Regards,
Vimal Singh



More information about the linux-mtd mailing list