• Home
  • Raw
  • Download

Lines Matching refs:nbc

45 	struct nand_bch_control *nbc = chip->ecc.priv;  in nand_bch_calculate_ecc()  local
49 encode_bch(nbc->bch, buf, chip->ecc.size, code); in nand_bch_calculate_ecc()
53 code[i] ^= nbc->eccmask[i]; in nand_bch_calculate_ecc()
71 struct nand_bch_control *nbc = chip->ecc.priv; in nand_bch_correct_data() local
72 unsigned int *errloc = nbc->errloc; in nand_bch_correct_data()
75 count = decode_bch(nbc->bch, NULL, chip->ecc.size, read_ecc, calc_ecc, in nand_bch_correct_data()
115 struct nand_bch_control *nbc = NULL; in nand_bch_init() local
134 nbc = kzalloc(sizeof(*nbc), GFP_KERNEL); in nand_bch_init()
135 if (!nbc) in nand_bch_init()
138 nbc->bch = init_bch(m, t, 0); in nand_bch_init()
139 if (!nbc->bch) in nand_bch_init()
143 if (nbc->bch->ecc_bytes != eccbytes) { in nand_bch_init()
145 eccbytes, nbc->bch->ecc_bytes); in nand_bch_init()
161 layout = &nbc->ecclayout; in nand_bch_init()
191 nbc->eccmask = kmalloc(eccbytes, GFP_KERNEL); in nand_bch_init()
192 nbc->errloc = kmalloc(t*sizeof(*nbc->errloc), GFP_KERNEL); in nand_bch_init()
193 if (!nbc->eccmask || !nbc->errloc) in nand_bch_init()
203 memset(nbc->eccmask, 0, eccbytes); in nand_bch_init()
204 encode_bch(nbc->bch, erased_page, eccsize, nbc->eccmask); in nand_bch_init()
208 nbc->eccmask[i] ^= 0xff; in nand_bch_init()
213 return nbc; in nand_bch_init()
215 nand_bch_free(nbc); in nand_bch_init()
223 void nand_bch_free(struct nand_bch_control *nbc) in nand_bch_free() argument
225 if (nbc) { in nand_bch_free()
226 free_bch(nbc->bch); in nand_bch_free()
227 kfree(nbc->errloc); in nand_bch_free()
228 kfree(nbc->eccmask); in nand_bch_free()
229 kfree(nbc); in nand_bch_free()