diff options
Diffstat (limited to 'drivers/renesas/rcar/io/io_memdrv.c')
-rw-r--r-- | drivers/renesas/rcar/io/io_memdrv.c | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/drivers/renesas/rcar/io/io_memdrv.c b/drivers/renesas/rcar/io/io_memdrv.c index 7e8c1d3a65..1f31c0fb93 100644 --- a/drivers/renesas/rcar/io/io_memdrv.c +++ b/drivers/renesas/rcar/io/io_memdrv.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015-2019, Renesas Electronics Corporation. All rights reserved. + * Copyright (c) 2015-2021, Renesas Electronics Corporation. All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause */ @@ -11,8 +11,8 @@ #include <drivers/io/io_storage.h> #include "io_common.h" -#include "io_private.h" #include "io_memdrv.h" +#include "io_private.h" #include "rcar_def.h" extern void rcar_dma_exec(uintptr_t dst, uint32_t src, uint32_t len); @@ -21,7 +21,8 @@ static int32_t memdrv_dev_open(const uintptr_t dev __attribute__ ((unused)), io_dev_info_t **dev_info); static int32_t memdrv_dev_close(io_dev_info_t *dev_info); -/* As we need to be able to keep state for seek, only one file can be open +/* + * As we need to be able to keep state for seek, only one file can be open * at a time. Make this a structure and point to the entity->info. When we * can malloc memory we can change this to support more open files. */ @@ -43,12 +44,14 @@ static int32_t memdrv_block_open(io_dev_info_t *dev_info, const uintptr_t spec, { const io_drv_spec_t *block_spec = (io_drv_spec_t *) spec; - /* Since we need to track open state for seek() we only allow one open + /* + * Since we need to track open state for seek() we only allow one open * spec at a time. When we have dynamic memory we can malloc and set * entity->info. */ - if (current_file.in_use != 0U) + if (current_file.in_use != 0U) { return IO_RESOURCES_EXHAUSTED; + } /* File cursor offset for seek and incremental reads etc. */ current_file.base = block_spec->offset; @@ -63,8 +66,9 @@ static int32_t memdrv_block_open(io_dev_info_t *dev_info, const uintptr_t spec, static int32_t memdrv_block_seek(io_entity_t *entity, int32_t mode, signed long long offset) { - if (mode != IO_SEEK_SET) + if (mode != IO_SEEK_SET) { return IO_FAIL; + } ((file_state_t *) entity->info)->file_pos = offset; @@ -142,8 +146,9 @@ int32_t rcar_register_io_dev_memdrv(const io_dev_connector_t **dev_con) int32_t result; result = io_register_device(&memdrv_dev_info); - if (result == IO_SUCCESS) + if (result == IO_SUCCESS) { *dev_con = &memdrv_dev_connector; + } return result; } |