hc
2024-05-10 23fa18eaa71266feff7ba8d83022d9e1cc83c65a
kernel/include/linux/mtd/nand_bch.h
....@@ -1,9 +1,6 @@
1
+/* SPDX-License-Identifier: GPL-2.0-only */
12 /*
23 * Copyright © 2011 Ivan Djelic <ivan.djelic@parrot.com>
3
- *
4
- * This program is free software; you can redistribute it and/or modify
5
- * it under the terms of the GNU General Public License version 2 as
6
- * published by the Free Software Foundation.
74 *
85 * This file is the header for the NAND BCH ECC implementation.
96 */
....@@ -12,23 +9,24 @@
129 #define __MTD_NAND_BCH_H__
1310
1411 struct mtd_info;
12
+struct nand_chip;
1513 struct nand_bch_control;
1614
17
-#if defined(CONFIG_MTD_NAND_ECC_BCH)
15
+#if IS_ENABLED(CONFIG_MTD_NAND_ECC_SW_BCH)
1816
1917 static inline int mtd_nand_has_bch(void) { return 1; }
2018
2119 /*
2220 * Calculate BCH ecc code
2321 */
24
-int nand_bch_calculate_ecc(struct mtd_info *mtd, const u_char *dat,
22
+int nand_bch_calculate_ecc(struct nand_chip *chip, const u_char *dat,
2523 u_char *ecc_code);
2624
2725 /*
2826 * Detect and correct bit errors
2927 */
30
-int nand_bch_correct_data(struct mtd_info *mtd, u_char *dat, u_char *read_ecc,
31
- u_char *calc_ecc);
28
+int nand_bch_correct_data(struct nand_chip *chip, u_char *dat,
29
+ u_char *read_ecc, u_char *calc_ecc);
3230 /*
3331 * Initialize BCH encoder/decoder
3432 */
....@@ -38,19 +36,19 @@
3836 */
3937 void nand_bch_free(struct nand_bch_control *nbc);
4038
41
-#else /* !CONFIG_MTD_NAND_ECC_BCH */
39
+#else /* !CONFIG_MTD_NAND_ECC_SW_BCH */
4240
4341 static inline int mtd_nand_has_bch(void) { return 0; }
4442
4543 static inline int
46
-nand_bch_calculate_ecc(struct mtd_info *mtd, const u_char *dat,
44
+nand_bch_calculate_ecc(struct nand_chip *chip, const u_char *dat,
4745 u_char *ecc_code)
4846 {
4947 return -1;
5048 }
5149
5250 static inline int
53
-nand_bch_correct_data(struct mtd_info *mtd, unsigned char *buf,
51
+nand_bch_correct_data(struct nand_chip *chip, unsigned char *buf,
5452 unsigned char *read_ecc, unsigned char *calc_ecc)
5553 {
5654 return -ENOTSUPP;
....@@ -63,6 +61,6 @@
6361
6462 static inline void nand_bch_free(struct nand_bch_control *nbc) {}
6563
66
-#endif /* CONFIG_MTD_NAND_ECC_BCH */
64
+#endif /* CONFIG_MTD_NAND_ECC_SW_BCH */
6765
6866 #endif /* __MTD_NAND_BCH_H__ */