hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/Documentation/driver-api/mtdnand.rst
....@@ -180,10 +180,10 @@
180180 {
181181 struct nand_chip *this = mtd_to_nand(mtd);
182182 switch(cmd){
183
- case NAND_CTL_SETCLE: this->IO_ADDR_W |= CLE_ADRR_BIT; break;
184
- case NAND_CTL_CLRCLE: this->IO_ADDR_W &= ~CLE_ADRR_BIT; break;
185
- case NAND_CTL_SETALE: this->IO_ADDR_W |= ALE_ADRR_BIT; break;
186
- case NAND_CTL_CLRALE: this->IO_ADDR_W &= ~ALE_ADRR_BIT; break;
183
+ case NAND_CTL_SETCLE: this->legacy.IO_ADDR_W |= CLE_ADRR_BIT; break;
184
+ case NAND_CTL_CLRCLE: this->legacy.IO_ADDR_W &= ~CLE_ADRR_BIT; break;
185
+ case NAND_CTL_SETALE: this->legacy.IO_ADDR_W |= ALE_ADRR_BIT; break;
186
+ case NAND_CTL_CLRALE: this->legacy.IO_ADDR_W &= ~ALE_ADRR_BIT; break;
187187 }
188188 }
189189
....@@ -197,7 +197,7 @@
197197 should return 0, if the device is busy (R/B pin is low) and 1, if the
198198 device is ready (R/B pin is high). If the hardware interface does not
199199 give access to the ready busy pin, then the function must not be defined
200
-and the function pointer this->dev_ready is set to NULL.
200
+and the function pointer this->legacy.dev_ready is set to NULL.
201201
202202 Init function
203203 -------------
....@@ -235,14 +235,14 @@
235235 }
236236
237237 /* Set address of NAND IO lines */
238
- this->IO_ADDR_R = baseaddr;
239
- this->IO_ADDR_W = baseaddr;
238
+ this->legacy.IO_ADDR_R = baseaddr;
239
+ this->legacy.IO_ADDR_W = baseaddr;
240240 /* Reference hardware control function */
241241 this->hwcontrol = board_hwcontrol;
242242 /* Set command delay time, see datasheet for correct value */
243
- this->chip_delay = CHIP_DEPENDEND_COMMAND_DELAY;
243
+ this->legacy.chip_delay = CHIP_DEPENDEND_COMMAND_DELAY;
244244 /* Assign the device ready function, if available */
245
- this->dev_ready = board_dev_ready;
245
+ this->legacy.dev_ready = board_dev_ready;
246246 this->eccmode = NAND_ECC_SOFT;
247247
248248 /* Scan to find existence of the device */
....@@ -276,8 +276,10 @@
276276 #ifdef MODULE
277277 static void __exit board_cleanup (void)
278278 {
279
- /* Release resources, unregister device */
280
- nand_release (mtd_to_nand(board_mtd));
279
+ /* Unregister device */
280
+ WARN_ON(mtd_device_unregister(board_mtd));
281
+ /* Release resources */
282
+ nand_cleanup(mtd_to_nand(board_mtd));
281283
282284 /* unmap physical address */
283285 iounmap(baseaddr);
....@@ -336,17 +338,17 @@
336338 struct nand_chip *this = mtd_to_nand(mtd);
337339
338340 /* Deselect all chips */
339
- this->IO_ADDR_R &= ~BOARD_NAND_ADDR_MASK;
340
- this->IO_ADDR_W &= ~BOARD_NAND_ADDR_MASK;
341
+ this->legacy.IO_ADDR_R &= ~BOARD_NAND_ADDR_MASK;
342
+ this->legacy.IO_ADDR_W &= ~BOARD_NAND_ADDR_MASK;
341343 switch (chip) {
342344 case 0:
343
- this->IO_ADDR_R |= BOARD_NAND_ADDR_CHIP0;
344
- this->IO_ADDR_W |= BOARD_NAND_ADDR_CHIP0;
345
+ this->legacy.IO_ADDR_R |= BOARD_NAND_ADDR_CHIP0;
346
+ this->legacy.IO_ADDR_W |= BOARD_NAND_ADDR_CHIP0;
345347 break;
346348 ....
347349 case n:
348
- this->IO_ADDR_R |= BOARD_NAND_ADDR_CHIPn;
349
- this->IO_ADDR_W |= BOARD_NAND_ADDR_CHIPn;
350
+ this->legacy.IO_ADDR_R |= BOARD_NAND_ADDR_CHIPn;
351
+ this->legacy.IO_ADDR_W |= BOARD_NAND_ADDR_CHIPn;
350352 break;
351353 }
352354 }