浏览代码

Merge "asoc: codecs: wcd938x: Fix volatile register function"

qctecmdr 5 年之前
父节点
当前提交
e97d41b653
共有 1 个文件被更改,包括 5 次插入3 次删除
  1. 5 3
      asoc/codecs/wcd938x/wcd938x-regmap.c

+ 5 - 3
asoc/codecs/wcd938x/wcd938x-regmap.c

@@ -1,6 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0-only
 /*
- * Copyright (c) 2018, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2018-2019, The Linux Foundation. All rights reserved.
  */
 
 #include <linux/regmap.h>
@@ -494,8 +494,10 @@ static bool wcd938x_volatile_register(struct device *dev, unsigned int reg)
 {
 	if(reg <= WCD938X_BASE_ADDRESS)
 		return 0;
-	return (wcd938x_reg_access[WCD938X_REG(reg)] & RD_REG)
-		& ~(wcd938x_reg_access[WCD938X_REG(reg)] & WR_REG);
+	if ((wcd938x_reg_access[WCD938X_REG(reg)] & RD_REG)
+		&& !(wcd938x_reg_access[WCD938X_REG(reg)] & WR_REG))
+		return true;
+	return false;
 }
 
 struct regmap_config wcd938x_regmap_config = {