2022-04-07 02:16:47 +00:00
|
|
|
--- a/drivers/mtd/nand/spi/core.c
|
|
|
|
+++ b/drivers/mtd/nand/spi/core.c
|
|
|
|
@@ -19,6 +19,7 @@
|
|
|
|
#include <linux/string.h>
|
|
|
|
#include <linux/spi/spi.h>
|
|
|
|
#include <linux/spi/spi-mem.h>
|
|
|
|
+#include <linux/mtd/mtk_bmt.h>
|
|
|
|
|
|
|
|
static int spinand_read_reg_op(struct spinand_device *spinand, u8 reg, u8 *val)
|
|
|
|
{
|
2023-03-31 10:40:31 +00:00
|
|
|
@@ -1343,6 +1344,7 @@ static int spinand_probe(struct spi_mem
|
2022-04-07 02:16:47 +00:00
|
|
|
if (ret)
|
|
|
|
return ret;
|
|
|
|
|
|
|
|
+ mtk_bmt_attach(mtd);
|
|
|
|
ret = mtd_device_register(mtd, NULL, 0);
|
|
|
|
if (ret)
|
|
|
|
goto err_spinand_cleanup;
|
2023-03-31 10:40:31 +00:00
|
|
|
@@ -1350,6 +1352,7 @@ static int spinand_probe(struct spi_mem
|
2022-04-07 02:16:47 +00:00
|
|
|
return 0;
|
|
|
|
|
|
|
|
err_spinand_cleanup:
|
|
|
|
+ mtk_bmt_detach(mtd);
|
|
|
|
spinand_cleanup(spinand);
|
|
|
|
|
|
|
|
return ret;
|
2023-03-31 10:40:31 +00:00
|
|
|
@@ -1368,6 +1371,7 @@ static int spinand_remove(struct spi_mem
|
2022-04-07 02:16:47 +00:00
|
|
|
if (ret)
|
|
|
|
return ret;
|
|
|
|
|
|
|
|
+ mtk_bmt_detach(mtd);
|
|
|
|
spinand_cleanup(spinand);
|
|
|
|
|
|
|
|
return 0;
|