esp32_rng.c: Remove unused functions.

Signed-off-by: Abdelatif Guettouche <abdelatif.guettouche@espressif.com>
This commit is contained in:
Abdelatif Guettouche 2021-09-29 13:41:16 +02:00 committed by Gustavo Henrique Nihei
parent ee6138e9ba
commit 6a262c5203

View File

@ -61,8 +61,6 @@
static int esp32_rng_initialize(void);
static ssize_t esp32_rng_read(struct file *filep, char *buffer,
size_t buflen);
static int esp32_rng_open(struct file *filep);
/****************************************************************************
* Private Types
****************************************************************************/
@ -81,7 +79,6 @@ static struct rng_dev_s g_rngdev;
static const struct file_operations g_rngops =
{
.open = esp32_rng_open, /* open */
.read = esp32_rng_read, /* read */
};
@ -126,19 +123,9 @@ uint32_t IRAM_ATTR esp_random(void)
}
/****************************************************************************
* Name: esp32_rng_open
* Name: esp32_rng_initialize
****************************************************************************/
static void esp32_rng_start(void)
{
/* Nothing to do, bootloader already did it */
}
static void esp32_rng_stop(void)
{
/* Nothing to do */
}
static int esp32_rng_initialize(void)
{
static bool first_flag = true;
@ -157,25 +144,6 @@ static int esp32_rng_initialize(void)
nxsem_init(&g_rngdev.rd_sem, 0, 1);
nxsem_set_protocol(&g_rngdev.rd_sem, SEM_PRIO_NONE);
esp32_rng_stop();
return OK;
}
/****************************************************************************
* Name: esp32_rng_open
****************************************************************************/
static int esp32_rng_open(struct file *filep)
{
/* O_NONBLOCK is not supported */
if (filep->f_oflags & O_NONBLOCK)
{
_err("ESP32 RNG didn't support O_NONBLOCK mode.\n");
return -EPERM;
}
return OK;
}
@ -197,9 +165,7 @@ static ssize_t esp32_rng_read(struct file *filep, char *buffer,
read_len = buflen;
/* start RNG and Wait until the buffer is filled */
esp32_rng_start();
/* Wait until the buffer is filled */
while (buflen > 0)
{