Lines Matching defs:nbc
40 struct nand_bch_control *nbc = chip->ecc.priv;
44 bch_encode(nbc->bch, buf, chip->ecc.size, code);
48 code[i] ^= nbc->eccmask[i];
66 struct nand_bch_control *nbc = chip->ecc.priv;
67 unsigned int *errloc = nbc->errloc;
70 count = bch_decode(nbc->bch, NULL, chip->ecc.size, read_ecc, calc_ecc,
110 struct nand_bch_control *nbc = NULL;
129 nbc = kzalloc(sizeof(*nbc), GFP_KERNEL);
130 if (!nbc)
133 nbc->bch = bch_init(m, t, 0, false);
134 if (!nbc->bch)
138 if (nbc->bch->ecc_bytes != eccbytes) {
140 eccbytes, nbc->bch->ecc_bytes);
174 nbc->eccmask = kzalloc(eccbytes, GFP_KERNEL);
175 nbc->errloc = kmalloc_array(t, sizeof(*nbc->errloc), GFP_KERNEL);
176 if (!nbc->eccmask || !nbc->errloc)
186 bch_encode(nbc->bch, erased_page, eccsize, nbc->eccmask);
190 nbc->eccmask[i] ^= 0xff;
195 return nbc;
197 nand_bch_free(nbc);
204 * @nbc: NAND BCH control structure
206 void nand_bch_free(struct nand_bch_control *nbc)
208 if (nbc) {
209 bch_free(nbc->bch);
210 kfree(nbc->errloc);
211 kfree(nbc->eccmask);
212 kfree(nbc);