drivers: can: allow NULL init function

Generic device API allows for NULL init function, do the same for I2C.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
This commit is contained in:
Gerard Marull-Paretas 2023-04-18 15:48:51 +02:00 committed by Carles Cufí
parent 40957e3b49
commit 1b73d1e0c6

View file

@ -618,7 +618,11 @@ struct can_device_state {
stats_init(&state->stats.s_hdr, STATS_SIZE_32, 7, \
STATS_NAME_INIT_PARMS(can)); \
stats_register(dev->name, &(state->stats.s_hdr)); \
if (init_fn != NULL) { \
return init_fn(dev); \
} \
\
return 0; \
}
/** @endcond */