mirror of
https://github.com/eclipse-threadx/filex.git
synced 2026-09-13 19:45:58 +08:00
Fixed flush call in fx_media_format to mirror fx_media_close pattern
- Added blank line after #ifndef FX_MEDIA_STATISTICS_DISABLE for style consistency - Used local driver variable instead of media_ptr->fx_media_driver_entry - Removed early return on flush failure so FX_DRIVER_UNINIT is always called after FX_DRIVER_INIT, preventing driver resource leaks Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
co-authored by
Copilot
parent
339082886f
commit
edc2427de6
@@ -670,6 +670,7 @@ UINT sectors_per_fat, f, s;
|
||||
}
|
||||
|
||||
#ifndef FX_MEDIA_STATISTICS_DISABLE
|
||||
|
||||
/* Increment the number of driver flush requests. */
|
||||
media_ptr -> fx_media_driver_flush_requests++;
|
||||
#endif
|
||||
@@ -682,12 +683,7 @@ UINT sectors_per_fat, f, s;
|
||||
FX_TRACE_IN_LINE_INSERT(FX_TRACE_INTERNAL_IO_DRIVER_FLUSH, media_ptr, 0, 0, 0, FX_TRACE_INTERNAL_EVENTS, 0, 0)
|
||||
|
||||
/* Call the specified I/O driver with the flush request. */
|
||||
(media_ptr -> fx_media_driver_entry) (media_ptr);
|
||||
|
||||
if (media_ptr -> fx_media_driver_status != FX_SUCCESS)
|
||||
{
|
||||
return(media_ptr -> fx_media_driver_status);
|
||||
}
|
||||
(driver)(media_ptr);
|
||||
|
||||
/* Build the "uninitialize" I/O driver request. */
|
||||
media_ptr -> fx_media_driver_request = FX_DRIVER_UNINIT;
|
||||
|
||||
Reference in New Issue
Block a user