xiaoxiang781216 commented on code in PR #16642: URL: https://github.com/apache/nuttx/pull/16642#discussion_r2190221789
########## drivers/mtd/ftl.c: ########## @@ -914,5 +1010,5 @@ int ftl_initialize(int minor, FAR struct mtd_dev_s *mtd) /* Do the real work by ftl_initialize_by_path */ snprintf(path, DEV_NAME_MAX, "/dev/mtdblock%d", minor); - return ftl_initialize_by_path(path, mtd); + return ftl_initialize_by_path(path, mtd, O_RDWR); Review Comment: > If oflags will be set by `ftl_initialize_by_path`, it should be possible to set them with `ftl_initialize` as well. ftl_initialize is called in board initialization routine once to create a ftl wrapper on top of mtd, so it want the default behavior in normal case, that's why this patch doesn't change the prototype of ftl_initialize, because: 1. All call site need change to pass O_RDWR to keep the original behavior if the prototype change 2. If caller want some special behavior, they can simply change ftl_initialize to ftl_initialize_by_path -- 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-unsubscr...@nuttx.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org