drivers: can: handlers: can_get_max_bitrate() is an optional

The can_get_max_bitrate() is an optional API function. Limit validation
to the CAN device driver pointer.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
This commit is contained in:
Henrik Brix Andersen 2022-03-31 21:08:57 +02:00 committed by Carles Cufí
commit 49424574c5

View file

@ -48,7 +48,8 @@ static inline int z_vrfy_can_get_core_clock(const struct device *dev,
static inline int z_vrfy_can_get_max_bitrate(const struct device *dev,
uint32_t *max_bitrate)
{
Z_OOPS(Z_SYSCALL_DRIVER_CAN(dev, get_max_bitrate));
/* Optional API function */
Z_OOPS(Z_SYSCALL_OBJ(dev, K_OBJ_DRIVER_CAN));
Z_OOPS(Z_SYSCALL_MEMORY_WRITE(max_bitrate, sizeof(*max_bitrate)));
return z_impl_can_get_max_bitrate(dev, max_bitrate);