drivers: can: change can_tx_callback_t function signature

Change the can_tx_callback_t function signature to use an "int" (not an
uint32_t) for representing transmission errors.

The "error" callback function parameter is functionally equivalent to
the return value from can_send() and thus needs to use the same data
type and needs to be able to hold negative errno values.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
This commit is contained in:
Henrik Brix Andersen 2021-12-28 22:28:54 +01:00 committed by Christopher Friedt
commit b1b77c1774
11 changed files with 39 additions and 39 deletions

View file

@ -257,11 +257,11 @@ struct can_timing {
* @typedef can_tx_callback_t
* @brief Defines the application callback handler function signature
*
* @param error_flags Status of the performed send operation. See the list of
* return values for @a can_send() for value descriptions.
* @param user_data User data provided when the frame was sent.
* @param error Status of the performed send operation. See the list of
* return values for @a can_send() for value descriptions.
* @param user_data User data provided when the frame was sent.
*/
typedef void (*can_tx_callback_t)(uint32_t error_flags, void *user_data);
typedef void (*can_tx_callback_t)(int error, void *user_data);
/**
* @typedef can_rx_callback_t