330-snand-mtk-bmt-support.patch 808 B

12345678910111213141516171819202122232425262728293031323334
  1. --- a/drivers/mtd/nand/spi/core.c
  2. +++ b/drivers/mtd/nand/spi/core.c
  3. @@ -19,6 +19,7 @@
  4. #include <linux/string.h>
  5. #include <linux/spi/spi.h>
  6. #include <linux/spi/spi-mem.h>
  7. +#include <linux/mtd/mtk_bmt.h>
  8. static int spinand_read_reg_op(struct spinand_device *spinand, u8 reg, u8 *val)
  9. {
  10. @@ -1345,6 +1346,7 @@ static int spinand_probe(struct spi_mem
  11. if (ret)
  12. return ret;
  13. + mtk_bmt_attach(mtd);
  14. ret = mtd_device_register(mtd, NULL, 0);
  15. if (ret)
  16. goto err_spinand_cleanup;
  17. @@ -1352,6 +1354,7 @@ static int spinand_probe(struct spi_mem
  18. return 0;
  19. err_spinand_cleanup:
  20. + mtk_bmt_detach(mtd);
  21. spinand_cleanup(spinand);
  22. return ret;
  23. @@ -1370,6 +1373,7 @@ static int spinand_remove(struct spi_mem
  24. if (ret)
  25. return ret;
  26. + mtk_bmt_detach(mtd);
  27. spinand_cleanup(spinand);
  28. return 0;