]> git.karo-electronics.de Git - karo-tx-linux.git/commit
mtd: nand: refactor erase_cmd() to return chip status
authorBrian Norris <computersforpeace@gmail.com>
Tue, 6 May 2014 23:02:19 +0000 (16:02 -0700)
committerNitin Garg <nitin.garg@freescale.com>
Fri, 16 Jan 2015 03:16:40 +0000 (21:16 -0600)
commite5500bff785809fba08bc599d276cc190ff805e5
treea31e40d5c88b77d95167ae308dc08e9f855ffe24
parent615820812e7b370f402036890f6d90095ace2727
mtd: nand: refactor erase_cmd() to return chip status

The nand_chip::erase_cmd callback previously served a dual purpose; for
one, it allowed a per-flash-chip override, so that AG-AND devices could
use a different erase command than other NAND. These AND devices were
dropped in commit 14c6578683367b1e7af0c3c09e872b45a45183a7 (mtd: nand:
remove AG-AND support). On the other hand, some drivers (denali and
doc-g4) need to use this sort of callback to implement
controller-specific erase operations.

To make the latter operation easier for some drivers (e.g., ST's new BCH
NAND driver), it helps if the command dispatch and wait functions can be
lumped together, rather than called separately.

This patch does two things:
 1. Pull the call to chip->waitfunc() into chip->erase_cmd(), and return
    the status from this callback
 2. Rename erase_cmd() to just erase(), since this callback does a
    little more than just send a command

Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Tested-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Huang Shijie <b32955@freescale.com>
drivers/mtd/nand/denali.c
drivers/mtd/nand/docg4.c
drivers/mtd/nand/nand_base.c
include/linux/mtd/nand.h