Skip to content
Commit f393e220 authored by Henrik Brix Andersen's avatar Henrik Brix Andersen Committed by Stephanos Ioannidis
Browse files

drivers: can: mark CAN-FD data phase timing API as optional



The can_set_timing_data() API function is optional and is not supported by
all CAN controller drivers.

On a board with only either classic CAN or CAN-FD capable controllers the
current behavior is fine, but on boards with a mix of classic CAN and
CAN-FD capable controllers/drivers, calling can_set_timing_data() on a
classic CAN controller will lead to a NULL pointer dereference.

To ensure a proper behavior when calling can_set_timing_data() on classic
CAN controller drivers, change the API wrapper function to return -ENOSYS
if the CAN driver does not implement CAN-FD support.

Note that the data phase timing calculation functions are fine as-is, as
the timing calculations will fail due to minimum/maximum data phase timing
parameters being all zeros for drivers only supporting classic CAN.

Signed-off-by: default avatarHenrik Brix Andersen <hebad@vestas.com>
parent dad8364d
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment