bsps/jffs2_flashdev: Return correct value for OOB size

Return the actual out of bounds size per page instead of the ioctl
return status. JFFS2 will happily operate with an OOB size of 0 and
instead put cleanmarkers in the normal page space of the flash.
This commit is contained in:
Kinsey Moore
2025-10-23 15:28:19 -05:00
parent cfc9ee2e60
commit 2cb47d2010

View File

@@ -179,10 +179,17 @@ static uint32_t do_get_oob_size(
rtems_jffs2_flash_control *super
)
{
int rv;
int fd = fileno(get_flash_control( super )->handle);
size_t bytes_per_page = 0;
return ioctl(fd, RTEMS_FLASHDEV_IOCTL_OOB_BYTES_PER_PAGE, &bytes_per_page);
rv = ioctl(fd, RTEMS_FLASHDEV_IOCTL_OOB_BYTES_PER_PAGE, &bytes_per_page);
if (rv != 0) {
return 0;
}
return bytes_per_page;
}
static void do_destroy( rtems_jffs2_flash_control *super )