summaryrefslogtreecommitdiffstats
path: root/drivers/mtd/nand/raw/nand_base.c
diff options
context:
space:
mode:
authorBoris Brezillon <boris.brezillon@bootlin.com>2018-09-06 14:05:31 +0200
committerMiquel Raynal <miquel.raynal@bootlin.com>2018-10-03 11:12:25 +0200
commitaa36ff25ffdea656c3b748a5cf141bc884e6275c (patch)
treea25c252db8075b5695c078b7a2390c60b775e0b3 /drivers/mtd/nand/raw/nand_base.c
parentmtd: rawnand: Pass a nand_chip object to chip->erase() (diff)
downloadlinux-aa36ff25ffdea656c3b748a5cf141bc884e6275c.tar.xz
linux-aa36ff25ffdea656c3b748a5cf141bc884e6275c.zip
mtd: rawnand: Pass a nand_chip object to chip->{get, set}_features()
Let's make the raw NAND API consistent by patching all helpers and hooks to take a nand_chip object instead of an mtd_info one or remove the mtd_info object when both are passed. Let's tackle the chip->{get,set}_features() hooks. Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Diffstat (limited to 'drivers/mtd/nand/raw/nand_base.c')
-rw-r--r--drivers/mtd/nand/raw/nand_base.c21
1 files changed, 6 insertions, 15 deletions
diff --git a/drivers/mtd/nand/raw/nand_base.c b/drivers/mtd/nand/raw/nand_base.c
index 26be436eb8f1..0ae597ced5b4 100644
--- a/drivers/mtd/nand/raw/nand_base.c
+++ b/drivers/mtd/nand/raw/nand_base.c
@@ -1163,12 +1163,10 @@ static bool nand_supports_set_features(struct nand_chip *chip, int addr)
int nand_get_features(struct nand_chip *chip, int addr,
u8 *subfeature_param)
{
- struct mtd_info *mtd = nand_to_mtd(chip);
-
if (!nand_supports_get_features(chip, addr))
return -ENOTSUPP;
- return chip->get_features(mtd, chip, addr, subfeature_param);
+ return chip->get_features(chip, addr, subfeature_param);
}
EXPORT_SYMBOL_GPL(nand_get_features);
@@ -1184,12 +1182,10 @@ EXPORT_SYMBOL_GPL(nand_get_features);
int nand_set_features(struct nand_chip *chip, int addr,
u8 *subfeature_param)
{
- struct mtd_info *mtd = nand_to_mtd(chip);
-
if (!nand_supports_set_features(chip, addr))
return -ENOTSUPP;
- return chip->set_features(mtd, chip, addr, subfeature_param);
+ return chip->set_features(chip, addr, subfeature_param);
}
EXPORT_SYMBOL_GPL(nand_set_features);
@@ -4846,13 +4842,11 @@ static int nand_max_bad_blocks(struct mtd_info *mtd, loff_t ofs, size_t len)
/**
* nand_default_set_features- [REPLACEABLE] set NAND chip features
- * @mtd: MTD device structure
* @chip: nand chip info structure
* @addr: feature address.
* @subfeature_param: the subfeature parameters, a four bytes array.
*/
-static int nand_default_set_features(struct mtd_info *mtd,
- struct nand_chip *chip, int addr,
+static int nand_default_set_features(struct nand_chip *chip, int addr,
uint8_t *subfeature_param)
{
return nand_set_features_op(chip, addr, subfeature_param);
@@ -4860,13 +4854,11 @@ static int nand_default_set_features(struct mtd_info *mtd,
/**
* nand_default_get_features- [REPLACEABLE] get NAND chip features
- * @mtd: MTD device structure
* @chip: nand chip info structure
* @addr: feature address.
* @subfeature_param: the subfeature parameters, a four bytes array.
*/
-static int nand_default_get_features(struct mtd_info *mtd,
- struct nand_chip *chip, int addr,
+static int nand_default_get_features(struct nand_chip *chip, int addr,
uint8_t *subfeature_param)
{
return nand_get_features_op(chip, addr, subfeature_param);
@@ -4874,7 +4866,6 @@ static int nand_default_get_features(struct mtd_info *mtd,
/**
* nand_get_set_features_notsupp - set/get features stub returning -ENOTSUPP
- * @mtd: MTD device structure
* @chip: nand chip info structure
* @addr: feature address.
* @subfeature_param: the subfeature parameters, a four bytes array.
@@ -4882,8 +4873,8 @@ static int nand_default_get_features(struct mtd_info *mtd,
* Should be used by NAND controller drivers that do not support the SET/GET
* FEATURES operations.
*/
-int nand_get_set_features_notsupp(struct mtd_info *mtd, struct nand_chip *chip,
- int addr, u8 *subfeature_param)
+int nand_get_set_features_notsupp(struct nand_chip *chip, int addr,
+ u8 *subfeature_param)
{
return -ENOTSUPP;
}