Prechádzať zdrojové kódy

soundwire: Suppress errors due to unsupported slave functions

Suppress the errors from the soundwire master runtime suspend
and runtime resume, if the soundwire slave devices does not
implement the functionality, that avoids pm runtime calling
the runtime functions.

Change-Id: I513a37f37e349a0c435295056df8625f284e13e6
Signed-off-by: Sudheer Papothi <[email protected]>
Sudheer Papothi 6 rokov pred
rodič
commit
79c9075948
1 zmenil súbory, kde vykonal 12 pridanie a 2 odobranie
  1. 12 2
      soc/swr-mstr-ctrl.c

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

@@ -2293,7 +2293,12 @@ static int swrm_runtime_resume(struct device *dev)
 			enable_bank_switch(swrm, 0, SWR_ROW_50, SWR_MIN_COL);
 			list_for_each_entry(swr_dev, &mstr->devices, dev_list) {
 				ret = swr_device_up(swr_dev);
-				if (ret) {
+				if (ret == -ENODEV) {
+					dev_dbg(dev,
+						"%s slave device up not implemented\n",
+						__func__);
+					ret = 0;
+				} else if (ret) {
 					dev_err(dev,
 						"%s: failed to wakeup swr dev %d\n",
 						__func__, swr_dev->dev_num);
@@ -2358,7 +2363,12 @@ static int swrm_runtime_suspend(struct device *dev)
 			swr_master_write(swrm, SWRM_COMP_CFG_ADDR, 0x00);
 			list_for_each_entry(swr_dev, &mstr->devices, dev_list) {
 				ret = swr_device_down(swr_dev);
-				if (ret) {
+				if (ret == -ENODEV) {
+					dev_dbg_ratelimited(dev,
+						"%s slave device down not implemented\n",
+						__func__);
+					ret = 0;
+				} else if (ret) {
 					dev_err(dev,
 						"%s: failed to shutdown swr dev %d\n",
 						__func__, swr_dev->dev_num);