summary refs log tree commit diff
path: root/drivers/mfd/qcom-spmi-pmic.c
diff options
context:
space:
mode:
authorIvan T. Ivanov <ivan.ivanov@linaro.org>2015-11-17 16:06:44 -0800
committerLee Jones <lee.jones@linaro.org>2016-01-11 06:23:32 +0000
commit742dcd115cb523f4b518bfcda870e10a027a8024 (patch)
treee3d03e6e252decb063fefa0d2639b28369dda623 /drivers/mfd/qcom-spmi-pmic.c
parenta5656a708050bd3be5c3a3bc45297db21e88cecd (diff)
downloadlinux-742dcd115cb523f4b518bfcda870e10a027a8024.tar.gz
mfd: qcom-spmi-pmic: Don't access non-existing registers
Revision ID registers are available only on devices with
Slave IDs that are even, so don't make access to unavailable
registers.

Signed-off-by: Ivan T. Ivanov <ivan.ivanov@linaro.org>
[sboyd@codeaurora.org: Consider all slave ids that are even]
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Diffstat (limited to 'drivers/mfd/qcom-spmi-pmic.c')
-rw-r--r--drivers/mfd/qcom-spmi-pmic.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/mfd/qcom-spmi-pmic.c b/drivers/mfd/qcom-spmi-pmic.c
index af6ac1c4b45c..8653e8b9bb4f 100644
--- a/drivers/mfd/qcom-spmi-pmic.c
+++ b/drivers/mfd/qcom-spmi-pmic.c
@@ -127,7 +127,9 @@ static int pmic_spmi_probe(struct spmi_device *sdev)
 	if (IS_ERR(regmap))
 		return PTR_ERR(regmap);
 
-	pmic_spmi_show_revid(regmap, &sdev->dev);
+	/* Only the first slave id for a PMIC contains this information */
+	if (sdev->usid % 2 == 0)
+		pmic_spmi_show_revid(regmap, &sdev->dev);
 
 	return of_platform_populate(root, NULL, NULL, &sdev->dev);
 }