All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stefan Roese <sr@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH resend 7/7] mtd/st_smi: Add mtd support for smi
Date: Thu, 06 Dec 2012 09:02:36 +0100	[thread overview]
Message-ID: <50C0511C.4030205@denx.de> (raw)
In-Reply-To: <549a68c6f353eafc3c52098a45257a1403cf5a4b.1354774371.git.vipin.kumar@st.com>

On 12/06/2012 07:21 AM, Vipin Kumar wrote:
> This patch adds mtd device support for smi devices
> 
> Signed-off-by: Vipin Kumar <vipin.kumar@st.com>
> ---
>  drivers/mtd/st_smi.c | 167 ++++++++++++++++++++++++++++++++++++++++++++++++++-
>  1 file changed, 165 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/mtd/st_smi.c b/drivers/mtd/st_smi.c
> index 0e529a4..4d1a6bd 100644
> --- a/drivers/mtd/st_smi.c
> +++ b/drivers/mtd/st_smi.c
> @@ -24,6 +24,7 @@
>  #include <common.h>
>  #include <flash.h>
>  #include <linux/err.h>
> +#include <linux/mtd/mtd.h>
>  #include <linux/mtd/st_smi.h>
>  
>  #include <asm/io.h>
> @@ -37,6 +38,14 @@ static ulong bank_base[CONFIG_SYS_MAX_FLASH_BANKS] =
>      CONFIG_SYS_FLASH_ADDR_BASE;
>  flash_info_t flash_info[CONFIG_SYS_MAX_FLASH_BANKS];
>  
> +#if defined(CONFIG_MTD_DEVICE)
> +/* MTD interface for SMI devices */
> +static struct mtd_info smi_mtd_info[CONFIG_SYS_MAX_FLASH_BANKS];
> +static char smi_mtd_names[CONFIG_SYS_MAX_FLASH_BANKS][16];
> +
> +static int smi_mtd_init(void);
> +#endif
> +
>  /* data structure to maintain flash ids from different vendors */
>  struct flash_device {
>  	char *name;
> @@ -482,7 +491,9 @@ unsigned long flash_init(void)
>  {
>  	unsigned long size = 0;
>  	int i, j;
> -
> +#if defined(CONFIG_MTD_DEVICE)
> +	int error;
> +#endif

Hmm, I don't like all those new #ifdef's. Can't we instead add a dummy
smi_mtd_init() functions for the non-MTD version? Something like:

#if defined(CONFIG_MTD_DEVICE)
/* MTD interface for SMI devices */
static struct mtd_info smi_mtd_info[CONFIG_SYS_MAX_FLASH_BANKS];
static char smi_mtd_names[CONFIG_SYS_MAX_FLASH_BANKS][16];

static int smi_mtd_init(void);
#else
static int smi_mtd_init(void)
{
	return 0;
}
#endif

What do you think?

Thanks,
Stefan

  reply	other threads:[~2012-12-06  8:02 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-06  6:21 [U-Boot] [PATCH resend 0/7] mtd/st_smi: Add fixes for smi driver Vipin Kumar
2012-12-06  6:21 ` [U-Boot] [PATCH resend 1/7] mtd/st_smi: Clear error flags while initiating a fresh write Vipin Kumar
2012-12-06  7:37   ` Stefan Roese
2012-12-06  8:16     ` Vipin Kumar
2012-12-06  6:21 ` [U-Boot] [PATCH resend 2/7] mtd/st_smi: Rearrange the supported devices in alphabetical order Vipin Kumar
2012-12-06  7:37   ` Stefan Roese
2012-12-06  6:21 ` [U-Boot] [PATCH resend 3/7] mtd/st_smi: Add support for Micron N25Q128 Flash Vipin Kumar
2012-12-06  7:38   ` Stefan Roese
2012-12-06  6:21 ` [U-Boot] [PATCH resend 4/7] mtd/st_smi: Avoid issuing multiple WE commands Vipin Kumar
2012-12-06  7:44   ` Stefan Roese
2012-12-06  6:21 ` [U-Boot] [PATCH resend 5/7] mtd/st_smi: Write to flash in a tight loop Vipin Kumar
2012-12-06  7:51   ` Stefan Roese
2012-12-06  6:21 ` [U-Boot] [PATCH resend 6/7] mtd/st_smi: Use page sizes respective to flash Vipin Kumar
2012-12-06  7:53   ` Stefan Roese
2012-12-06  6:21 ` [U-Boot] [PATCH resend 7/7] mtd/st_smi: Add mtd support for smi Vipin Kumar
2012-12-06  8:02   ` Stefan Roese [this message]
2012-12-06  8:36     ` Vipin Kumar
2012-12-06  7:35 ` [U-Boot] [PATCH resend 0/7] mtd/st_smi: Add fixes for smi driver Stefan Roese
2012-12-06  8:19   ` Vipin Kumar
2012-12-06  8:32     ` Stefan Roese
2012-12-06  8:48       ` Vipin Kumar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=50C0511C.4030205@denx.de \
    --to=sr@denx.de \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.