diff --git a/bsp/imxrt/libraries/drivers/drv_can.c b/bsp/imxrt/libraries/drivers/drv_can.c index b8adae6c65..dc4840a22f 100644 --- a/bsp/imxrt/libraries/drivers/drv_can.c +++ b/bsp/imxrt/libraries/drivers/drv_can.c @@ -430,7 +430,7 @@ static rt_ssize_t can_send(struct rt_can_device *can_dev, const void *buf, rt_ui return (rt_ssize_t)ret; } -static int can_recv(struct rt_can_device *can_dev, void *buf, rt_uint32_t boxno) +static rt_ssize_t can_recv(struct rt_can_device *can_dev, void *buf, rt_uint32_t boxno) { struct imxrt_can *can; struct rt_can_msg *pmsg; diff --git a/components/drivers/include/drivers/can.h b/components/drivers/include/drivers/can.h index ec69d35b5a..2ce60d8072 100644 --- a/components/drivers/include/drivers/can.h +++ b/components/drivers/include/drivers/can.h @@ -351,8 +351,8 @@ struct rt_can_ops { rt_err_t (*configure)(struct rt_can_device *can, struct can_configure *cfg); rt_err_t (*control)(struct rt_can_device *can, int cmd, void *arg); - int (*sendmsg)(struct rt_can_device *can, const void *buf, rt_uint32_t boxno); - int (*recvmsg)(struct rt_can_device *can, void *buf, rt_uint32_t boxno); + rt_ssize_t (*sendmsg)(struct rt_can_device *can, const void *buf, rt_uint32_t boxno); + rt_ssize_t (*recvmsg)(struct rt_can_device *can, void *buf, rt_uint32_t boxno); }; rt_err_t rt_hw_can_register(struct rt_can_device *can,