forked from ~ljy/RK356X_SDK_RELEASE

hc
2023-12-09 95099d4622f8cb224d94e314c7a8e0df60b13f87
kernel/drivers/mtd/nand/raw/sm_common.c
....@@ -1,10 +1,7 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * Copyright © 2009 - Maxim Levitsky
34 * Common routines & support for xD format
4
- *
5
- * This program is free software; you can redistribute it and/or modify
6
- * it under the terms of the GNU General Public License version 2 as
7
- * published by the Free Software Foundation.
85 */
96 #include <linux/kernel.h>
107 #include <linux/mtd/rawnand.h>
....@@ -99,8 +96,9 @@
9996 .free = oob_sm_small_ooblayout_free,
10097 };
10198
102
-static int sm_block_markbad(struct mtd_info *mtd, loff_t ofs)
99
+static int sm_block_markbad(struct nand_chip *chip, loff_t ofs)
103100 {
101
+ struct mtd_info *mtd = nand_to_mtd(chip);
104102 struct mtd_oob_ops ops;
105103 struct sm_oob oob;
106104 int ret;
....@@ -167,7 +165,7 @@
167165 /* Bad block marker position */
168166 chip->badblockpos = 0x05;
169167 chip->badblockbits = 7;
170
- chip->block_markbad = sm_block_markbad;
168
+ chip->legacy.block_markbad = sm_block_markbad;
171169
172170 /* ECC layout */
173171 if (mtd->writesize == SM_SECTOR_SIZE)
....@@ -193,7 +191,7 @@
193191 chip->options |= NAND_SKIP_BBTSCAN;
194192
195193 /* Scan for card properties */
196
- chip->dummy_controller.ops = &sm_controller_ops;
194
+ chip->legacy.dummy_controller.ops = &sm_controller_ops;
197195 flash_ids = smartmedia ? nand_smartmedia_flash_ids : nand_xd_flash_ids;
198196 ret = nand_scan_with_ids(chip, 1, flash_ids);
199197 if (ret)