Home | History | Annotate | Download | only in nand

Lines Matching refs:nbc

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