mirror of
https://gitlab.rtems.org/rtems/rtos/rtems.git
synced 2025-12-05 15:15:44 +00:00
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:
@@ -179,10 +179,17 @@ static uint32_t do_get_oob_size(
|
|||||||
rtems_jffs2_flash_control *super
|
rtems_jffs2_flash_control *super
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
int rv;
|
||||||
int fd = fileno(get_flash_control( super )->handle);
|
int fd = fileno(get_flash_control( super )->handle);
|
||||||
size_t bytes_per_page = 0;
|
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 )
|
static void do_destroy( rtems_jffs2_flash_control *super )
|
||||||
|
|||||||
Reference in New Issue
Block a user