Prechádzať zdrojové kódy

asoc: codecs: bolero: Do not return error for unused gpio

If soundwire gpio is not used, then no need to return
error if not able to get gpio data.

Change-Id: I97705b49d3b01f99b7a4e91190a15ffb211d32f2
Signed-off-by: Karthikeyan Mani <[email protected]>
Karthikeyan Mani 5 rokov pred
rodič
commit
b44e4551b1

+ 2 - 1
asoc/codecs/bolero/rx-macro.c

@@ -3763,7 +3763,8 @@ static int rx_macro_probe(struct platform_device *pdev)
 			__func__);
 		return -EINVAL;
 	}
-	if (msm_cdc_pinctrl_get_state(rx_priv->rx_swr_gpio_p) < 0) {
+	if (msm_cdc_pinctrl_get_state(rx_priv->rx_swr_gpio_p) < 0 &&
+		is_used_rx_swr_gpio) {
 		dev_err(&pdev->dev, "%s: failed to get swr pin state\n",
 			__func__);
 		return -EPROBE_DEFER;

+ 2 - 1
asoc/codecs/bolero/tx-macro.c

@@ -2299,7 +2299,8 @@ static int tx_macro_probe(struct platform_device *pdev)
 			__func__);
 		return -EINVAL;
 	}
-	if (msm_cdc_pinctrl_get_state(tx_priv->tx_swr_gpio_p) < 0) {
+	if (msm_cdc_pinctrl_get_state(tx_priv->tx_swr_gpio_p) < 0 &&
+			is_used_tx_swr_gpio) {
 		dev_err(&pdev->dev, "%s: failed to get swr pin state\n",
 			__func__);
 		return -EPROBE_DEFER;

+ 2 - 1
asoc/codecs/bolero/wsa-macro.c

@@ -2957,7 +2957,8 @@ static int wsa_macro_probe(struct platform_device *pdev)
 			__func__);
 		return -EINVAL;
 	}
-	if (msm_cdc_pinctrl_get_state(wsa_priv->wsa_swr_gpio_p) < 0) {
+	if (msm_cdc_pinctrl_get_state(wsa_priv->wsa_swr_gpio_p) < 0 &&
+			is_used_wsa_swr_gpio) {
 		dev_err(&pdev->dev, "%s: failed to get swr pin state\n",
 			__func__);
 		return -EPROBE_DEFER;