[PATCH 2/2] mtd: nand: add ONFI timing mode to nand_timings converter

Brian Norris computersforpeace at gmail.com
Mon Jul 21 19:39:47 PDT 2014


On Fri, Jul 11, 2014 at 09:49:42AM +0200, Boris BREZILLON wrote:
> --- /dev/null
> +++ b/drivers/mtd/nand/nand_timings.c
> @@ -0,0 +1,250 @@
> +/*
> + *  Copyright (C) 2014 Free Electrons
> + *
> + *  Author: Boris BREZILLON <boris.brezillon at free-electrons.com>
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License version 2 as
> + * published by the Free Software Foundation.
> + *
> + */
> +#include <linux/mtd/nand.h>
[...]
> +/**
> + * onfi_async_timing_mode_to_sdr_timings - [NAND Interface] Retrieve NAND
> + * timings according to the given ONFI timing mode
> + * @mode: ONFI timing mode
> + */
> +const struct nand_sdr_timings *onfi_async_timing_mode_to_sdr_timings(int mode)
> +{
> +	if (mode < 0 || mode >= ARRAY_SIZE(onfi_sdr_timings))

Might need <linux/kernel.h> for this.

> +		return ERR_PTR(-EINVAL);

And <linux/err.h> for this.

> +
> +	return &onfi_sdr_timings[mode];
> +}
> +EXPORT_SYMBOL(onfi_async_timing_mode_to_sdr_timings);

<linux/export.h> for this.

I'll squash in the appended diff.

Brian

diff --git a/drivers/mtd/nand/nand_timings.c b/drivers/mtd/nand/nand_timings.c
index f154780cf60f..8b36253420fa 100644
--- a/drivers/mtd/nand/nand_timings.c
+++ b/drivers/mtd/nand/nand_timings.c
@@ -8,6 +8,9 @@
  * published by the Free Software Foundation.
  *
  */
+#include <linux/kernel.h>
+#include <linux/err.h>
+#include <linux/export.h>
 #include <linux/mtd/nand.h>
 
 static const struct nand_sdr_timings onfi_sdr_timings[] = {




More information about the linux-mtd mailing list