diff --git a/arch/risc-v/src/esp32c3/esp32c3_rng.c b/arch/risc-v/src/esp32c3/esp32c3_rng.c index 54ad30297d..7a3d01c689 100644 --- a/arch/risc-v/src/esp32c3/esp32c3_rng.c +++ b/arch/risc-v/src/esp32c3/esp32c3_rng.c @@ -59,7 +59,6 @@ static int esp32c3_rng_initialize(void); static ssize_t esp32c3_rng_read(struct file *filep, char *buffer, size_t buflen); -static int esp32c3_rng_open(struct file *filep); /**************************************************************************** * Private Types @@ -79,7 +78,6 @@ static struct rng_dev_s g_rngdev; static const struct file_operations g_rngops = { - .open = esp32c3_rng_open, /* open */ .read = esp32c3_rng_read, /* read */ }; @@ -124,24 +122,6 @@ uint32_t IRAM_ATTR esp_random(void) return result ^ getreg32(WDEV_RND_REG); } -/**************************************************************************** - * Name: esp32c3_rng_start - ****************************************************************************/ - -static void esp32c3_rng_start(void) -{ - /* Nothing to do, bootloader already did it */ -} - -/**************************************************************************** - * Name: esp32c3_rng_stop - ****************************************************************************/ - -static void esp32c3_rng_stop(void) -{ - /* Nothing to do */ -} - /**************************************************************************** * Name: esp32c3_rng_initialize ****************************************************************************/ @@ -155,25 +135,6 @@ static int esp32c3_rng_initialize(void) nxsem_init(&g_rngdev.rd_sem, 0, 1); nxsem_set_protocol(&g_rngdev.rd_sem, SEM_PRIO_NONE); - esp32c3_rng_stop(); - - return OK; -} - -/**************************************************************************** - * Name: esp32c3_rng_open - ****************************************************************************/ - -static int esp32c3_rng_open(struct file *filep) -{ - /* O_NONBLOCK is not supported */ - - if (filep->f_oflags & O_NONBLOCK) - { - _err("ESP32-C3 RNG doesn't support O_NONBLOCK mode.\n"); - return -EPERM; - } - return OK; } @@ -195,11 +156,7 @@ static ssize_t esp32c3_rng_read(struct file *filep, char *buffer, read_len = buflen; - /* start RNG and wait until the buffer is filled */ - - esp32c3_rng_start(); - - /* Now, got data */ + /* Wait until the buffer is filled */ while (buflen > 0) {