RTEMS | can: add support for SJA1000 CAN controller (!1183)
Gedare Bloom (@gedare)
gitlab at rtems.org
Fri Apr 3 22:16:44 UTC 2026
Gedare Bloom started a new discussion on cpukit/dev/can/sja1000/sja1000.c: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/1183#note_148009
> + */
> +static int sja1000_start_chip( struct rtems_can_chip *chip )
> +{
> + struct sja1000_internal *internal = chip->internal;
> + int ret = 0;
> +
> + rtems_mutex_lock( &chip->lock );
> + if ( rtems_can_test_bit( RTEMS_CAN_CHIP_RUNNING, &chip->flags ) ) {
> + /* Chip was already configured, skip */
> + rtems_mutex_unlock( &chip->lock );
> + return 0;
> + }
> +
> + ret = sja1000_enable_configuration( internal );
> + if ( ret < 0)
> + goto start_chip_unlock;
we prefer to avoid `goto` flows. this one is simple enough to turn into a function call or just copy-paste the unlock+return
--
View it on GitLab: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/1183#note_148009
You're receiving this email because of your account on gitlab.rtems.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/bugs/attachments/20260403/4bbe7016/attachment-0001.htm>
More information about the bugs
mailing list