tn3399_openwrt/target/linux/mediatek/patches-5.15/330-snand-mtk-bmt-support.patch
Daniel Golle 884e63fa68 kernel: refresh patches
The introduction of the new Airoha target has left the tree in an
unfresh state. Refresh patches to improve that situation.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2022-09-07 04:21:41 +01:00

35 lines
808 B
Diff

--- 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)
{
@@ -1333,6 +1334,7 @@ static int spinand_probe(struct spi_mem
if (ret)
return ret;
+ mtk_bmt_attach(mtd);
ret = mtd_device_register(mtd, NULL, 0);
if (ret)
goto err_spinand_cleanup;
@@ -1340,6 +1342,7 @@ static int spinand_probe(struct spi_mem
return 0;
err_spinand_cleanup:
+ mtk_bmt_detach(mtd);
spinand_cleanup(spinand);
return ret;
@@ -1358,6 +1361,7 @@ static int spinand_remove(struct spi_mem
if (ret)
return ret;
+ mtk_bmt_detach(mtd);
spinand_cleanup(spinand);
return 0;