Message ID | 20210915122116.18317-5-peter.ujfalusi@linux.intel.com |
---|---|
State | Accepted |
Commit | 10d93a98190aec2c3ff98d9472ab1bf0543aa02c |
Headers | show |
Series | ASoC: SOF: Abstract away the 'bar' usage (mostly) | expand |
diff --git a/sound/soc/sof/imx/imx8.c b/sound/soc/sof/imx/imx8.c index 326aa65166c2..150f1bc3fb95 100644 --- a/sound/soc/sof/imx/imx8.c +++ b/sound/soc/sof/imx/imx8.c @@ -365,7 +365,14 @@ static int imx8_remove(struct snd_sof_dev *sdev) /* on i.MX8 there is 1 to 1 match between type and BAR idx */ static int imx8_get_bar_index(struct snd_sof_dev *sdev, u32 type) { - return type; + /* Only IRAM and SRAM bars are valid */ + switch (type) { + case SOF_FW_BLK_TYPE_IRAM: + case SOF_FW_BLK_TYPE_SRAM: + return type; + default: + return -EINVAL; + } } static void imx8_ipc_msg_data(struct snd_sof_dev *sdev,