All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vikram Narayanan <vikram186@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] nand_spl: Define nand_select function
Date: Tue, 23 Oct 2012 16:51:05 +0530	[thread overview]
Message-ID: <50867DA1.5070801@gmail.com> (raw)

Split up the selection of nand_chip from nand_init to a separate
function. This is just to make it a little consistent as we've
nand_deselect function.

Also use it in spl_nand_load_image function.

Signed-off-by: Vikram Narayanan <vikram186@gmail.com>
Cc: Stefan Roese <sr@denx.de>
---
 common/spl/spl_nand.c              |    1 +
 drivers/mtd/nand/nand_spl_simple.c |    6 +++++-
 2 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/common/spl/spl_nand.c b/common/spl/spl_nand.c
index 61de5a4..5ebeb38 100644
--- a/common/spl/spl_nand.c
+++ b/common/spl/spl_nand.c
@@ -34,6 +34,7 @@ void spl_nand_load_image(void)
 
 	debug("spl: nand - using hw ecc\n");
 	nand_init();
+	nand_select();
 
 	/*use CONFIG_SYS_TEXT_BASE as temporary storage area */
 	header = (struct image_header *)(CONFIG_SYS_TEXT_BASE);
diff --git a/drivers/mtd/nand/nand_spl_simple.c b/drivers/mtd/nand/nand_spl_simple.c
index 4a4d02f..77c56fc 100644
--- a/drivers/mtd/nand/nand_spl_simple.c
+++ b/drivers/mtd/nand/nand_spl_simple.c
@@ -270,12 +270,16 @@ void nand_init(void)
 		nand_chip.ecc.correct = nand_correct_data;
 	}
 #endif
+}
 
+/* Select before operation */
+void nand_select(void)
+{
 	if (nand_chip.select_chip)
 		nand_chip.select_chip(&mtd, 0);
 }
 
-/* Unselect after operation */
+/* Deselect after operation */
 void nand_deselect(void)
 {
 	if (nand_chip.select_chip)
-- 
1.7.4.1

             reply	other threads:[~2012-10-23 11:21 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-23 11:21 Vikram Narayanan [this message]
2012-10-23 15:47 ` [U-Boot] [PATCH] nand_spl: Define nand_select function Tom Rini
2012-10-23 17:31   ` Vikram Narayanan
2012-10-23 17:46     ` Tom Rini

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=50867DA1.5070801@gmail.com \
    --to=vikram186@gmail.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 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.