Prechádzať zdrojové kódy

soc: soundwire: Handle soundwire slave reset gracefully

If soundwire slave does not implement reset functionality, handle
soundwire slave reset error gracefully in soundwire master driver.

Change-Id: I24f34d3e8665c187c4ac9dd2bc8acb2b39ad2df6
Signed-off-by: Sudheer Papothi <[email protected]>
Sudheer Papothi 5 rokov pred
rodič
commit
669089fdbd
1 zmenil súbory, kde vykonal 7 pridanie a 2 odobranie
  1. 7 2
      soc/swr-mstr-ctrl.c

+ 7 - 2
soc/swr-mstr-ctrl.c

@@ -1,6 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0-only
 /*
- * Copyright (c) 2015-2019, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2015-2020, The Linux Foundation. All rights reserved.
  */
 
 #include <linux/irq.h>
@@ -3038,7 +3038,12 @@ int swrm_wcd_notify(struct platform_device *pdev, u32 id, void *data)
 		mutex_lock(&swrm->reslock);
 		list_for_each_entry(swr_dev, &mstr->devices, dev_list) {
 			ret = swr_reset_device(swr_dev);
-			if (ret) {
+			if (ret == -ENODEV) {
+				dev_dbg_ratelimited(swrm->dev,
+					"%s slave reset not implemented\n",
+					__func__);
+				ret = 0;
+			} else if (ret) {
 				dev_err(swrm->dev,
 					"%s: failed to reset swr device %d\n",
 					__func__, swr_dev->dev_num);