Commit d74fd06f authored by Paul Cercueil's avatar Paul Cercueil Committed by Miquel Raynal

mtd: rawnand: ingenic: Rename jz4780_bch_init to jz4780_bch_reset

The jz4780_bch_init name was confusing, as it suggested that its content
should be executed once at init time, whereas what the function really
does is reset the hardware for a new ECC operation.
Signed-off-by: default avatarPaul Cercueil <paul@crapouillou.net>
Signed-off-by: default avatarMiquel Raynal <miquel.raynal@bootlin.com>
parent a919619e
...@@ -69,8 +69,8 @@ struct jz4780_bch { ...@@ -69,8 +69,8 @@ struct jz4780_bch {
struct mutex lock; struct mutex lock;
}; };
static void jz4780_bch_init(struct jz4780_bch *bch, static void jz4780_bch_reset(struct jz4780_bch *bch,
struct jz4780_bch_params *params, bool encode) struct jz4780_bch_params *params, bool encode)
{ {
u32 reg; u32 reg;
...@@ -183,7 +183,8 @@ int jz4780_bch_calculate(struct jz4780_bch *bch, struct jz4780_bch_params *param ...@@ -183,7 +183,8 @@ int jz4780_bch_calculate(struct jz4780_bch *bch, struct jz4780_bch_params *param
int ret = 0; int ret = 0;
mutex_lock(&bch->lock); mutex_lock(&bch->lock);
jz4780_bch_init(bch, params, true);
jz4780_bch_reset(bch, params, true);
jz4780_bch_write_data(bch, buf, params->size); jz4780_bch_write_data(bch, buf, params->size);
if (jz4780_bch_wait_complete(bch, BCH_BHINT_ENCF, NULL)) { if (jz4780_bch_wait_complete(bch, BCH_BHINT_ENCF, NULL)) {
...@@ -220,7 +221,7 @@ int jz4780_bch_correct(struct jz4780_bch *bch, struct jz4780_bch_params *params, ...@@ -220,7 +221,7 @@ int jz4780_bch_correct(struct jz4780_bch *bch, struct jz4780_bch_params *params,
mutex_lock(&bch->lock); mutex_lock(&bch->lock);
jz4780_bch_init(bch, params, false); jz4780_bch_reset(bch, params, false);
jz4780_bch_write_data(bch, buf, params->size); jz4780_bch_write_data(bch, buf, params->size);
jz4780_bch_write_data(bch, ecc_code, params->bytes); jz4780_bch_write_data(bch, ecc_code, params->bytes);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment