mtd: rawnand: Pass a nand_chip object to ecc->calculate()
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. Now is ecc->calculate()'s turn. Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
This commit is contained in:

committed by
Miquel Raynal

parent
ec47636cd7
commit
af37d2c3a8
@@ -12,6 +12,7 @@
|
||||
#define __MTD_NAND_BCH_H__
|
||||
|
||||
struct mtd_info;
|
||||
struct nand_chip;
|
||||
struct nand_bch_control;
|
||||
|
||||
#if defined(CONFIG_MTD_NAND_ECC_BCH)
|
||||
@@ -21,7 +22,7 @@ static inline int mtd_nand_has_bch(void) { return 1; }
|
||||
/*
|
||||
* Calculate BCH ecc code
|
||||
*/
|
||||
int nand_bch_calculate_ecc(struct mtd_info *mtd, const u_char *dat,
|
||||
int nand_bch_calculate_ecc(struct nand_chip *chip, const u_char *dat,
|
||||
u_char *ecc_code);
|
||||
|
||||
/*
|
||||
@@ -43,7 +44,7 @@ void nand_bch_free(struct nand_bch_control *nbc);
|
||||
static inline int mtd_nand_has_bch(void) { return 0; }
|
||||
|
||||
static inline int
|
||||
nand_bch_calculate_ecc(struct mtd_info *mtd, const u_char *dat,
|
||||
nand_bch_calculate_ecc(struct nand_chip *chip, const u_char *dat,
|
||||
u_char *ecc_code)
|
||||
{
|
||||
return -1;
|
||||
|
@@ -14,6 +14,7 @@
|
||||
#define __MTD_NAND_ECC_H__
|
||||
|
||||
struct mtd_info;
|
||||
struct nand_chip;
|
||||
|
||||
/*
|
||||
* Calculate 3 byte ECC code for eccsize byte block
|
||||
@@ -24,7 +25,8 @@ void __nand_calculate_ecc(const u_char *dat, unsigned int eccsize,
|
||||
/*
|
||||
* Calculate 3 byte ECC code for 256/512 byte block
|
||||
*/
|
||||
int nand_calculate_ecc(struct mtd_info *mtd, const u_char *dat, u_char *ecc_code);
|
||||
int nand_calculate_ecc(struct nand_chip *chip, const u_char *dat,
|
||||
u_char *ecc_code);
|
||||
|
||||
/*
|
||||
* Detect and correct a 1 bit error for eccsize byte block
|
||||
|
@@ -648,8 +648,8 @@ struct nand_ecc_ctrl {
|
||||
u8 *calc_buf;
|
||||
u8 *code_buf;
|
||||
void (*hwctl)(struct nand_chip *chip, int mode);
|
||||
int (*calculate)(struct mtd_info *mtd, const uint8_t *dat,
|
||||
uint8_t *ecc_code);
|
||||
int (*calculate)(struct nand_chip *chip, const uint8_t *dat,
|
||||
uint8_t *ecc_code);
|
||||
int (*correct)(struct mtd_info *mtd, uint8_t *dat, uint8_t *read_ecc,
|
||||
uint8_t *calc_ecc);
|
||||
int (*read_page_raw)(struct mtd_info *mtd, struct nand_chip *chip,
|
||||
|
Reference in New Issue
Block a user