drivers: clock_control: nxp: Fix building MCG on KW40Z/KW41Z

The KW40Z/KW41Z don't have a Fixed Freq MCG clock so the code
associated with that in get_rate fails to build.  ifdef around
the code with enum kCLOCK_McgFixedFreqClk so things work
correctly.

Signed-off-by: Kumar Gala <galak@kernel.org>
This commit is contained in:
Kumar Gala 2022-07-22 02:14:28 -05:00 committed by Carles Cufí
parent 8b101e236d
commit 83a2b590fe
1 changed files with 2 additions and 0 deletions

View File

@ -37,9 +37,11 @@ static int mcux_mcg_get_rate(const struct device *dev,
clock_name_t clock_name;
switch ((uint32_t) sub_system) {
#ifdef kCLOCK_McgFixedFreqClk
case KINETIS_MCG_FIXED_FREQ_CLK:
clock_name = kCLOCK_McgFixedFreqClk;
break;
#endif
case KINETIS_MCG_OUT_CLK:
*rate = CLOCK_GetOutClkFreq();
return 0;