drivers: eSPI: fixed build error in eSPI socketpair test suite.

Fixed build error in in eSPI socketpair test suite since wrong function
name for eSPI flash channel api.

This CL also fixed [-Werror=unused-function] warning by adding inline
attribute in case someone includes "espi_utils.h" and doesn't call
espi_manage_callback() function.

Signed-off-by: Mulin Chao <MLChao@nuvoton.com>
This commit is contained in:
Mulin Chao 2020-09-10 17:49:56 +08:00 committed by Carles Cufí
commit e12d1ae851
2 changed files with 5 additions and 5 deletions

View file

@ -55,7 +55,7 @@ static inline int z_vrfy_espi_write_lpc_request(const struct device *dev,
Z_OOPS(Z_SYSCALL_DRIVER_ESPI(dev, write_lpc_request)); Z_OOPS(Z_SYSCALL_DRIVER_ESPI(dev, write_lpc_request));
Z_OOPS(z_user_from_copy(&data_copy, data, sizeof(*data))); Z_OOPS(z_user_from_copy(&data_copy, data, sizeof(*data)));
return z_impl_espi_write_lpc_request(dev, op, data_copy); return z_impl_espi_write_lpc_request(dev, op, &data_copy);
} }
#include <syscalls/espi_write_lpc_request_mrsh.c> #include <syscalls/espi_write_lpc_request_mrsh.c>
@ -164,7 +164,7 @@ static inline int z_vrfy_espi_read_flash(const struct device *dev,
int ret; int ret;
struct espi_flash_packet pckt_copy; struct espi_flash_packet pckt_copy;
Z_OOPS(Z_SYSCALL_DRIVER_ESPI(dev, read_flash)); Z_OOPS(Z_SYSCALL_DRIVER_ESPI(dev, flash_read));
Z_OOPS(z_user_from_copy(&pckt_copy, pckt, Z_OOPS(z_user_from_copy(&pckt_copy, pckt,
sizeof(struct espi_flash_packet))); sizeof(struct espi_flash_packet)));
Z_OOPS(Z_SYSCALL_MEMORY_WRITE(pckt->buf, pckt->len)); Z_OOPS(Z_SYSCALL_MEMORY_WRITE(pckt->buf, pckt->len));
@ -183,7 +183,7 @@ static inline int z_vrfy_espi_write_flash(const struct device *dev,
int ret; int ret;
struct espi_flash_packet pckt_copy; struct espi_flash_packet pckt_copy;
Z_OOPS(Z_SYSCALL_DRIVER_ESPI(dev, write_flash)); Z_OOPS(Z_SYSCALL_DRIVER_ESPI(dev, flash_write));
Z_OOPS(z_user_from_copy(&pckt_copy, pckt, Z_OOPS(z_user_from_copy(&pckt_copy, pckt,
sizeof(struct espi_flash_packet))); sizeof(struct espi_flash_packet)));
Z_OOPS(Z_SYSCALL_MEMORY_READ(pckt->buf, pckt->len)); Z_OOPS(Z_SYSCALL_MEMORY_READ(pckt->buf, pckt->len));
@ -200,7 +200,7 @@ static inline int z_vrfy_espi_flash_erase(const struct device *dev,
int ret; int ret;
struct espi_flash_packet pckt_copy; struct espi_flash_packet pckt_copy;
Z_OOPS(Z_SYSCALL_DRIVER_ESPI(dev, write_flash)); Z_OOPS(Z_SYSCALL_DRIVER_ESPI(dev, flash_write));
Z_OOPS(z_user_from_copy(&pckt_copy, pckt, Z_OOPS(z_user_from_copy(&pckt_copy, pckt,
sizeof(struct espi_flash_packet))); sizeof(struct espi_flash_packet)));
Z_OOPS(Z_SYSCALL_MEMORY_READ(pckt->buf, pckt->len)); Z_OOPS(Z_SYSCALL_MEMORY_READ(pckt->buf, pckt->len));

View file

@ -20,7 +20,7 @@
* *
* @return 0 on success, negative errno otherwise. * @return 0 on success, negative errno otherwise.
*/ */
static int espi_manage_callback(sys_slist_t *callbacks, static inline int espi_manage_callback(sys_slist_t *callbacks,
struct espi_callback *callback, bool set) struct espi_callback *callback, bool set)
{ {
__ASSERT(callback, "No callback!"); __ASSERT(callback, "No callback!");