[PATCH 3/3] Fix compilation without MTD partitioning support

Eric Miao eric.y.miao at gmail.com
Tue Jan 6 22:20:25 EST 2009


On Wed, Jan 7, 2009 at 10:40 AM, Marcel Ziswiler <marcel at ziswiler.com> wrote:
> This fixes compilation without MTD partitioning support previously failing.
>
> Signed-off-by: Marcel Ziswiler <marcel at ziswiler.com>
> ---
>  drivers/mtd/nand/pxa3xx_nand.c |    6 ++++++
>  1 files changed, 6 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/mtd/nand/pxa3xx_nand.c b/drivers/mtd/nand/pxa3xx_nand.c
> index d2da717..90cadc9 100644
> --- a/drivers/mtd/nand/pxa3xx_nand.c
> +++ b/drivers/mtd/nand/pxa3xx_nand.c
> @@ -1162,7 +1162,11 @@ static int pxa3xx_nand_probe(struct platform_device *pdev)
>                goto fail_free_irq;
>        }
>
> +#ifdef CONFIG_MTD_PARTITIONS
>        return add_mtd_partitions(mtd, pdata->parts, pdata->nr_parts);
> +#else
> +       return 0;
> +#endif
>

or maybe

#ifdef CONFIG_MTD_PARTITIONS
        ret = add_mtd_partitions(...)
#endif
        return ret;

I don't personally like mutual exclusive #ifdef.

>  fail_free_irq:
>        free_irq(IRQ_NAND, info);
> @@ -1193,7 +1197,9 @@ static int pxa3xx_nand_remove(struct platform_device *pdev)
>        platform_set_drvdata(pdev, NULL);
>
>        del_mtd_device(mtd);
> +#ifdef CONFIG_MTD_PARTITIONS
>        del_mtd_partitions(mtd);
> +#endif
>        free_irq(IRQ_NAND, info);
>        if (use_dma) {
>                pxa_free_dma(info->data_dma_ch);
> --
> 1.6.0.6
>
>

Otherwise looks OK to me.

-- 
Cheers
- eric



More information about the linux-mtd mailing list