drivers: clock_control_nrf: Prevent break from becoming dead code
When both NRF_CLOCK_HAS_XO_TUNE and NRF_CLOCK_HAS_PLL evaluate to 0, one break statement can end up not associated with any case and become dead code. Refactor a bit the related switch to avoid such situation. Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
This commit is contained in:
parent
d963fc01e6
commit
77a7cb3e4f
1 changed files with 6 additions and 8 deletions
|
@ -692,6 +692,10 @@ static void clock_event_handler(nrfx_clock_evt_type_t event)
|
|||
case NRFX_CLOCK_EVT_XO_TUNED:
|
||||
clkstarted_handle(dev, CLOCK_CONTROL_NRF_TYPE_HFCLK);
|
||||
break;
|
||||
case NRFX_CLOCK_EVT_XO_TUNE_ERROR:
|
||||
case NRFX_CLOCK_EVT_XO_TUNE_FAILED:
|
||||
/* No processing needed. */
|
||||
break;
|
||||
case NRFX_CLOCK_EVT_HFCLK_STARTED:
|
||||
/* HFCLK is stable after XOTUNED event.
|
||||
* HFCLK_STARTED means only that clock has been started.
|
||||
|
@ -743,15 +747,9 @@ static void clock_event_handler(nrfx_clock_evt_type_t event)
|
|||
#endif
|
||||
#if NRF_CLOCK_HAS_PLL
|
||||
case NRFX_CLOCK_EVT_PLL_STARTED:
|
||||
#endif
|
||||
#if NRF_CLOCK_HAS_XO_TUNE
|
||||
case NRFX_CLOCK_EVT_XO_TUNE_ERROR:
|
||||
case NRFX_CLOCK_EVT_XO_TUNE_FAILED:
|
||||
#endif
|
||||
{
|
||||
/* unhandled event */
|
||||
/* No processing needed. */
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
default:
|
||||
__ASSERT_NO_MSG(0);
|
||||
break;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue