You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2022/06/13 14:44:48 UTC

[GitHub] [incubator-nuttx] pkarashchenko commented on a diff in pull request #6424: arm/tlsr82: bugfix, tlsr82_flash_ioctl() return wrong value.

pkarashchenko commented on code in PR #6424:
URL: https://github.com/apache/incubator-nuttx/pull/6424#discussion_r895804674


##########
arch/arm/src/tlsr82/tlsr82_flash_mtd.c:
##########
@@ -429,7 +446,14 @@ static int tlsr82_flash_test(struct tlsr82_flash_dev_s *priv)
   int k;
 
   ferr("Erase chip for byte write test\n");
-  tlsr82_flash_chip_erase(priv);
+  ret = tlsr82_flash_ioctl(&priv->mtd, MTDIOC_BULKERASE,
+                           (unsigned long)NULL);

Review Comment:
   ```suggestion
     ret = tlsr82_flash_ioctl(&priv->mtd, MTDIOC_BULKERASE, 0);
   ```



##########
arch/arm/src/tlsr82/tlsr82_flash_mtd.c:
##########
@@ -504,7 +528,14 @@ static int tlsr82_flash_test(struct tlsr82_flash_dev_s *priv)
   /* 1) erase the chip */
 
   ferr("Erase chip for protect/unprotect test\n");
-  tlsr82_flash_chip_erase(priv);
+  ret = tlsr82_flash_ioctl(&priv->mtd, MTDIOC_BULKERASE,
+                           (unsigned long)NULL);

Review Comment:
   ```suggestion
     ret = tlsr82_flash_ioctl(&priv->mtd, MTDIOC_BULKERASE, 0);
   ```



##########
arch/arm/src/tlsr82/tlsr82_flash_mtd.c:
##########
@@ -354,7 +364,14 @@ static int tlsr82_flash_test(struct tlsr82_flash_dev_s *priv)
   ferr("Flash chip erase test start:\n");
 
   FLASH_ERASE_TRACE_START();
-  tlsr82_flash_chip_erase(priv);
+  ret = tlsr82_flash_ioctl(&priv->mtd, MTDIOC_BULKERASE,
+                           (unsigned long)NULL);

Review Comment:
   ```suggestion
     ret = tlsr82_flash_ioctl(&priv->mtd, MTDIOC_BULKERASE, 0);
   ```



##########
arch/arm/src/tlsr82/tlsr82_flash_mtd.c:
##########
@@ -523,7 +554,13 @@ static int tlsr82_flash_test(struct tlsr82_flash_dev_s *priv)
   /* 3) protect the flash, read the flash status register */
 
   FLASH_PROT_TRACE_START();
-  tlsr82_flash_protect();
+  ret = tlsr82_flash_ioctl(&priv->mtd, MTDIOC_PROTECT, (unsigned long)NULL);

Review Comment:
   ```suggestion
     ret = tlsr82_flash_ioctl(&priv->mtd, MTDIOC_PROTECT, 0);
   ```



##########
arch/arm/src/tlsr82/tlsr82_flash_mtd.c:
##########
@@ -539,7 +576,14 @@ static int tlsr82_flash_test(struct tlsr82_flash_dev_s *priv)
     }
 
   FLASH_UNPROT_TRACE_START();
-  tlsr82_flash_unprotect();
+  ret = tlsr82_flash_ioctl(&priv->mtd, MTDIOC_UNPROTECT,
+                           (unsigned long)NULL);

Review Comment:
   ```suggestion
     ret = tlsr82_flash_ioctl(&priv->mtd, MTDIOC_UNPROTECT, 0);
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org