public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Simon Schwarz <simonschwarzcor@googlemail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH V3 1/2] nand: Add common functions to linux/mtd/nand.h
Date: Mon, 31 Oct 2011 17:34:44 +0100	[thread overview]
Message-ID: <1320078885-383-2-git-send-email-simonschwarzcor@gmail.com> (raw)
In-Reply-To: <1320078885-383-1-git-send-email-simonschwarzcor@gmail.com>

Functions often used in SPL are now part of linux/mtd/nand.h.
Static modifiers are removed from these functions in
drivers/mtd/nand/nand_base.c.

Signed-off-by: Simon Schwarz <simonschwarzcor@gmail.com>
Cc: scottwood at freescale.com
Cc: s-paulraj at ti.com
Cc: albert.u.boot at aribaud.net
---
Changes V2:
CHG moved function definiton from nand.h to linux/mtd/nand.h because of:
	http://article.gmane.org/gmane.comp.boot-loaders.u-boot/110219

Changes V3:
CHG moved the definitions before double inculsion detection end
CHG combined function definition and prototype in one patch as advised here:
	http://article.gmane.org/gmane.comp.boot-loaders.u-boot/114558
---
 drivers/mtd/nand/nand_base.c |    6 +++---
 include/linux/mtd/nand.h     |    7 +++++++
 include/nand.h               |    3 ---
 3 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
index e7dfcb1..109d2cf 100644
--- a/drivers/mtd/nand/nand_base.c
+++ b/drivers/mtd/nand/nand_base.c
@@ -133,7 +133,7 @@ static void nand_release_device (struct mtd_info *mtd)
  *
  * Default read function for 8bit buswith
  */
-static uint8_t nand_read_byte(struct mtd_info *mtd)
+uint8_t nand_read_byte(struct mtd_info *mtd)
 {
 	struct nand_chip *chip = mtd->priv;
 	return readb(chip->IO_ADDR_R);
@@ -196,7 +196,7 @@ static void nand_select_chip(struct mtd_info *mtd, int chipnr)
  *
  * Default write function for 8bit buswith
  */
-static void nand_write_buf(struct mtd_info *mtd, const uint8_t *buf, int len)
+void nand_write_buf(struct mtd_info *mtd, const uint8_t *buf, int len)
 {
 	int i;
 	struct nand_chip *chip = mtd->priv;
@@ -249,7 +249,7 @@ static int nand_verify_buf(struct mtd_info *mtd, const uint8_t *buf, int len)
  *
  * Default write function for 16bit buswith
  */
-static void nand_write_buf16(struct mtd_info *mtd, const uint8_t *buf, int len)
+void nand_write_buf16(struct mtd_info *mtd, const uint8_t *buf, int len)
 {
 	int i;
 	struct nand_chip *chip = mtd->priv;
diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h
index 987a2ec..1cdc7ae 100644
--- a/include/linux/mtd/nand.h
+++ b/include/linux/mtd/nand.h
@@ -623,4 +623,11 @@ struct platform_nand_chip *get_platform_nandchip(struct mtd_info *mtd)
 	return chip->priv;
 }
 
+/* Standard NAND functions from nand_base.c */
+void nand_write_buf(struct mtd_info *mtd, const uint8_t *buf, int len);
+void nand_write_buf16(struct mtd_info *mtd, const uint8_t *buf, int len);
+void nand_read_buf(struct mtd_info *mtd, uint8_t *buf, int len);
+void nand_read_buf16(struct mtd_info *mtd, uint8_t *buf, int len);
+uint8_t nand_read_byte(struct mtd_info *mtd);
+
 #endif /* __LINUX_MTD_NAND_H */
diff --git a/include/nand.h b/include/nand.h
index b4140794..d444ddc 100644
--- a/include/nand.h
+++ b/include/nand.h
@@ -135,9 +135,6 @@ int nand_get_lock_status(nand_info_t *meminfo, loff_t offset);
 int nand_spl_load_image(uint32_t offs, unsigned int size, void *dst);
 void nand_deselect(void);
 
-void nand_read_buf16(struct mtd_info *mtd, uint8_t *buf, int len);
-void nand_read_buf(struct mtd_info *mtd, uint8_t *buf, int len);
-
 #ifdef CONFIG_SYS_NAND_SELECT_DEVICE
 void board_nand_select_device(struct nand_chip *nand, int chip);
 #endif
-- 
1.7.4.1

  reply	other threads:[~2011-10-31 16:34 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-29  7:44 [U-Boot] [PATCH 0/3] fix: regression in SMDK6400 Simon Schwarz
2011-09-29  7:44 ` [U-Boot] [PATCH 1/3] nand: Remove static modifier from common functions Simon Schwarz
2011-09-29  7:44 ` [U-Boot] [PATCH 2/3] nand: Add common functions to nand.h Simon Schwarz
2011-10-03 23:54   ` Scott Wood
     [not found]     ` <CAA5zgp_P9LtYraPUPQSM1PPDg_eGHAJ0F-qXHwiF-B+69NS1oQ@mail.gmail.com>
2011-10-14 18:09       ` Simon Schwarz
2011-09-29  7:44 ` [U-Boot] [PATCH 3/3] Fix regression in SMDK6400 Simon Schwarz
2011-09-29 16:07 ` [U-Boot] [PATCH 0/3] fix: " Scott Wood
2011-10-16 10:50 ` Simon Schwarz
2011-10-16 10:50   ` [U-Boot] [PATCH 1/3] nand: Remove static modifier from common functions Simon Schwarz
2011-10-28 20:45     ` Scott Wood
2011-10-16 10:50   ` [U-Boot] [PATCH 2/3] nand: Add common functions to linux/mtd/nand.h Simon Schwarz
2011-10-28 20:46     ` Scott Wood
2011-10-16 10:50   ` [U-Boot] [PATCH 3/3] Fix regression in SMDK6400 Simon Schwarz
2011-10-31 16:34   ` [U-Boot] [PATCH V3 0/2] fix: " Simon Schwarz
2011-10-31 16:34     ` Simon Schwarz [this message]
2011-10-31 17:52       ` [U-Boot] [PATCH V3 1/2] nand: Add common functions to linux/mtd/nand.h Scott Wood
2011-11-25 19:05         ` Albert ARIBAUD
2011-11-25 19:12           ` Albert ARIBAUD
2011-10-31 16:34     ` [U-Boot] [PATCH V3 2/2] Fix regression in SMDK6400 Simon Schwarz
2011-11-25 19:40     ` [U-Boot] [PATCH V3 0/2] fix: " Albert ARIBAUD
2011-11-29  8:32       ` Simon Schwarz

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=1320078885-383-2-git-send-email-simonschwarzcor@gmail.com \
    --to=simonschwarzcor@googlemail.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox