drivers: uart: Switch timeout values to s32_t in UART async API

Use signed values for timeout in UART asynchronous API, to be consistent
with timeout type in timer and workqueue values.

Signed-off-by: Mieszko Mierunski <mieszko.mierunski@nordicsemi.no>
This commit is contained in:
Mieszko Mierunski 2020-01-24 16:12:11 +01:00 committed by Carles Cufí
parent 6317c82f06
commit dc3c906d12
2 changed files with 11 additions and 10 deletions

View file

@ -49,7 +49,7 @@ static inline void z_vrfy_uart_poll_out(struct device *dev,
*/
static inline int z_vrfy_uart_tx(struct device *dev, const u8_t *buf,
size_t len, u32_t timeout)
size_t len, s32_t timeout)
{
Z_OOPS(Z_SYSCALL_DRIVER_UART(dev, tx));
Z_OOPS(Z_SYSCALL_MEMORY_READ(buf, len));
@ -61,7 +61,7 @@ UART_SIMPLE(tx_abort);
#include <syscalls/uart_tx_abort_mrsh.c>
static inline int z_vrfy_uart_rx_enable(struct device *dev, u8_t *buf,
size_t len, u32_t timeout)
size_t len, s32_t timeout)
{
Z_OOPS(Z_SYSCALL_DRIVER_UART(dev, rx_enable));
Z_OOPS(Z_SYSCALL_MEMORY_WRITE(buf, len));

View file

@ -350,11 +350,11 @@ struct uart_driver_api {
void *user_data);
int (*tx)(struct device *dev, const u8_t *buf, size_t len,
u32_t timeout);
s32_t timeout);
int (*tx_abort)(struct device *dev);
int (*rx_enable)(struct device *dev, u8_t *buf, size_t len,
u32_t timeout);
s32_t timeout);
int (*rx_buf_rsp)(struct device *dev, u8_t *buf, size_t len);
int (*rx_disable)(struct device *dev);
@ -460,16 +460,17 @@ static inline int uart_callback_set(struct device *dev,
* @param dev UART device structure.
* @param buf Pointer to transmit buffer.
* @param len Length of transmit buffer.
* @param timeout Timeout in milliseconds. Valid only if flow control is enabled
* @param timeout Timeout in milliseconds. Valid only if flow control is
* enabled. K_FOREVER disables timeout.
*
* @retval -EBUSY There is already an ongoing transfer.
* @retval 0 If successful, negative errno code otherwise.
*/
__syscall int uart_tx(struct device *dev, const u8_t *buf, size_t len,
u32_t timeout);
s32_t timeout);
static inline int z_impl_uart_tx(struct device *dev, const u8_t *buf,
size_t len, u32_t timeout)
size_t len, s32_t timeout)
{
const struct uart_driver_api *api =
@ -508,17 +509,17 @@ static inline int z_impl_uart_tx_abort(struct device *dev)
* @param dev UART device structure.
* @param buf Pointer to receive buffer.
* @param len Buffer length.
* @param timeout Timeout in milliseconds.
* @param timeout Timeout in milliseconds. K_FOREVER disables timeout.
*
* @retval -EBUSY RX already in progress.
* @retval 0 If successful, negative errno code otherwise.
*
*/
__syscall int uart_rx_enable(struct device *dev, u8_t *buf, size_t len,
u32_t timeout);
s32_t timeout);
static inline int z_impl_uart_rx_enable(struct device *dev, u8_t *buf,
size_t len, u32_t timeout)
size_t len, s32_t timeout)
{
const struct uart_driver_api *api =
(const struct uart_driver_api *)dev->driver_api;