Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Ivan T. Ivanov and committed by
Lee Jones
742dcd11 a5656a70

+3 -1
+3 -1
drivers/mfd/qcom-spmi-pmic.c
··· 127 127 if (IS_ERR(regmap)) 128 128 return PTR_ERR(regmap); 129 129 130 - pmic_spmi_show_revid(regmap, &sdev->dev); 130 + /* Only the first slave id for a PMIC contains this information */ 131 + if (sdev->usid % 2 == 0) 132 + pmic_spmi_show_revid(regmap, &sdev->dev); 131 133 132 134 return of_platform_populate(root, NULL, NULL, &sdev->dev); 133 135 }