Parcourir la source

Merge "asoc: codec: wcd9378: defer the probe if msm cdc pinctrl is not probed"

qctecmdr il y a 1 an
Parent
commit
4ac0b26319
1 fichiers modifiés avec 7 ajouts et 3 suppressions
  1. 7 3
      asoc/codecs/wcd9378/wcd9378.c

+ 7 - 3
asoc/codecs/wcd9378/wcd9378.c

@@ -4033,7 +4033,7 @@ static int wcd9378_reset(struct device *dev)
 	if (rc) {
 		dev_err(dev, "%s: wcd sleep state request fail!\n",
 				__func__);
-		return rc;
+		return -EPROBE_DEFER;
 	}
 	/* 20us sleep required after pulling the reset gpio to LOW */
 	usleep_range(20, 30);
@@ -4042,7 +4042,7 @@ static int wcd9378_reset(struct device *dev)
 	if (rc) {
 		dev_err(dev, "%s: wcd active state request fail!\n",
 				__func__);
-		return rc;
+		return -EPROBE_DEFER;
 	}
 	/* 20us sleep required after pulling the reset gpio to HIGH */
 	usleep_range(20, 30);
@@ -4442,7 +4442,11 @@ static int wcd9378_probe(struct platform_device *pdev)
 	if (ret)
 		goto err_lock_init;
 
-	wcd9378_reset(dev);
+	ret = wcd9378_reset(dev);
+	if (ret == -EPROBE_DEFER) {
+		dev_err(dev, "%s: wcd reset failed!\n", __func__);
+		goto err_lock_init;
+	}
 
 	wcd9378->wakeup = wcd9378_wakeup;