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.

Closes #5379
This commit is contained in:
Kinsey Moore
2025-10-23 15:28:19 -05:00
parent 36a3845d9c
commit 665b09e692

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 )