提交 742dcd11 编写于 作者: I Ivan T. Ivanov 提交者: Lee Jones

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: NIvan T. Ivanov <ivan.ivanov@linaro.org>
[sboyd@codeaurora.org: Consider all slave ids that are even]
Signed-off-by: NStephen Boyd <sboyd@codeaurora.org>
Signed-off-by: NLee Jones <lee.jones@linaro.org>
上级 a5656a70
......@@ -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);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册