Переглянути джерело

Merge "asoc: sm6150: Fix logic in comparison of sound card name"

Linux Build Service Account 6 роки тому
батько
коміт
23ce3cad70
1 змінених файлів з 8 додано та 8 видалено
  1. 8 8
      asoc/sm6150.c

+ 8 - 8
asoc/sm6150.c

@@ -8767,8 +8767,8 @@ static int msm_init_aux_dev(struct platform_device *pdev,
 		__func__, found);
 
 codec_aux_dev:
-	if (!strnstr(card->name, "tavil", sizeof("tavil")) &&
-	    !strnstr(card->name, "tasha", sizeof("tasha"))) {
+	if (!strnstr(card->name, "tavil", strlen(card->name)) &&
+	    !strnstr(card->name, "tasha", strlen(card->name))) {
 		/* Get maximum aux codec device count for this platform */
 		ret = of_property_read_u32(pdev->dev.of_node,
 					   "qcom,codec-max-aux-devs",
@@ -9003,8 +9003,8 @@ static int sm6150_ssr_enable(struct device *dev, void *data)
 		goto err;
 	}
 
-	if (strnstr(card->name, "tavil", sizeof("tavil")) ||
-	    strnstr(card->name, "tasha", sizeof("tasha"))) {
+	if (strnstr(card->name, "tavil", strlen(card->name)) ||
+	    strnstr(card->name, "tasha", strlen(card->name))) {
 		pdata = snd_soc_card_get_drvdata(card);
 		if (!pdata->is_afe_config_done) {
 			const char *be_dl_name = LPASS_BE_SLIMBUS_0_RX;
@@ -9054,8 +9054,8 @@ static void sm6150_ssr_disable(struct device *dev, void *data)
 	dev_dbg(dev, "%s: setting snd_card to OFFLINE\n", __func__);
 	snd_soc_card_change_online_state(card, 0);
 
-	if (strnstr(card->name, "tavil", sizeof("tavil")) ||
-	    strnstr(card->name, "tasha", sizeof("tasha"))) {
+	if (strnstr(card->name, "tavil", strlen(card->name)) ||
+	    strnstr(card->name, "tasha", strlen(card->name))) {
 		pdata = snd_soc_card_get_drvdata(card);
 		msm_afe_clear_config();
 		pdata->is_afe_config_done = false;
@@ -9281,8 +9281,8 @@ static int msm_asoc_machine_probe(struct platform_device *pdev)
 	}
 
 	msm_i2s_auxpcm_init(pdev);
-	if (!strnstr(card->name, "tavil", sizeof("tavil")) &&
-	    !strnstr(card->name, "tasha", sizeof("tasha"))) {
+	if (!strnstr(card->name, "tavil", strlen(card->name)) &&
+	    !strnstr(card->name, "tasha", strlen(card->name))) {
 		pdata->dmic01_gpio_p = of_parse_phandle(pdev->dev.of_node,
 						      "qcom,cdc-dmic01-gpios",
 						       0);