| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Copyright © 2009 - Maxim Levitsky |
|---|
| 3 | 4 | * 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. |
|---|
| 8 | 5 | */ |
|---|
| 9 | 6 | #include <linux/kernel.h> |
|---|
| 10 | 7 | #include <linux/mtd/rawnand.h> |
|---|
| .. | .. |
|---|
| 99 | 96 | .free = oob_sm_small_ooblayout_free, |
|---|
| 100 | 97 | }; |
|---|
| 101 | 98 | |
|---|
| 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) |
|---|
| 103 | 100 | { |
|---|
| 101 | + struct mtd_info *mtd = nand_to_mtd(chip); |
|---|
| 104 | 102 | struct mtd_oob_ops ops; |
|---|
| 105 | 103 | struct sm_oob oob; |
|---|
| 106 | 104 | int ret; |
|---|
| .. | .. |
|---|
| 167 | 165 | /* Bad block marker position */ |
|---|
| 168 | 166 | chip->badblockpos = 0x05; |
|---|
| 169 | 167 | chip->badblockbits = 7; |
|---|
| 170 | | - chip->block_markbad = sm_block_markbad; |
|---|
| 168 | + chip->legacy.block_markbad = sm_block_markbad; |
|---|
| 171 | 169 | |
|---|
| 172 | 170 | /* ECC layout */ |
|---|
| 173 | 171 | if (mtd->writesize == SM_SECTOR_SIZE) |
|---|
| .. | .. |
|---|
| 193 | 191 | chip->options |= NAND_SKIP_BBTSCAN; |
|---|
| 194 | 192 | |
|---|
| 195 | 193 | /* Scan for card properties */ |
|---|
| 196 | | - chip->dummy_controller.ops = &sm_controller_ops; |
|---|
| 194 | + chip->legacy.dummy_controller.ops = &sm_controller_ops; |
|---|
| 197 | 195 | flash_ids = smartmedia ? nand_smartmedia_flash_ids : nand_xd_flash_ids; |
|---|
| 198 | 196 | ret = nand_scan_with_ids(chip, 1, flash_ids); |
|---|
| 199 | 197 | if (ret) |
|---|