mfd: sec-core: Fix uninitialized 'regmap_rtc' on S2MPA01
authorKrzysztof Kozlowski <k.kozlowski@samsung.com>
Tue, 18 Mar 2014 13:11:26 +0000 (14:11 +0100)
committerLee Jones <lee.jones@linaro.org>
Thu, 20 Mar 2014 15:57:23 +0000 (15:57 +0000)
Initialize the 'regmap_rtc' on S2MPA01 to some sane value. Sane at least
for S5M87X chipsets, not S2MPS/S2MPA but it won't be used because
rtc-s5m driver does not support S2MPA01.

This fixes following error:
drivers/mfd/sec-core.c:342:45: warning: ‘regmap_rtc’ may be used uninitialized in this function [-Wuninitialized]

Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Acked-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
drivers/mfd/sec-core.c

index 91405e94cfee2f8badf44a792a0c80293547426d..1cf27521fff4f2fe4a2892d651b5d47e4721286e 100644 (file)
@@ -298,6 +298,13 @@ static int sec_pmic_probe(struct i2c_client *i2c,
        switch (sec_pmic->device_type) {
        case S2MPA01:
                regmap = &s2mpa01_regmap_config;
+               /*
+                * The rtc-s5m driver does not support S2MPA01 and there
+                * is no mfd_cell for S2MPA01 RTC device.
+                * However we must pass something to devm_regmap_init_i2c()
+                * so use S5M-like regmap config even though it wouldn't work.
+                */
+               regmap_rtc = &s5m_rtc_regmap_config;
                break;
        case S2MPS11X:
                regmap = &s2mps11_regmap_config;