mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Krzysztof Kozlowski <k.kozlowski@samsung.com>
To: Lee Jones <lee.jones@linaro.org>
Cc: Sachin Kamat <sachin.kamat@linaro.org>,
	broonie@kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	Krzysztof Kozlowski <k.kozlowski@samsung.com>
Subject: [PATCH] mfd: sec-core: Fix uninitialized 'regmap_rtc' on S2MPA01
Date: Tue, 18 Mar 2014 14:11:26 +0100	[thread overview]
Message-ID: <1395148286-32002-1-git-send-email-k.kozlowski@samsung.com> (raw)
In-Reply-To: <20140318110947.GR25478@lee--X1>

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>
---
 drivers/mfd/sec-core.c |    7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/mfd/sec-core.c b/drivers/mfd/sec-core.c
index 281a827..f5e09d0 100644
--- a/drivers/mfd/sec-core.c
+++ b/drivers/mfd/sec-core.c
@@ -295,6 +295,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;
-- 
1.7.9.5


  parent reply	other threads:[~2014-03-18 13:11 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-14 11:51 [PATCH v4 1/3] mfd: Add support for S2MPA01 device Sachin Kamat
2014-03-14 11:51 ` [PATCH v4 2/3] regulator: Add support for S2MPA01 regulator Sachin Kamat
2014-03-18  9:12   ` Lee Jones
2014-03-14 11:51 ` [PATCH v4 3/3] Documentation: mfd: Add binding document for S2MPA01 Sachin Kamat
2014-03-18  9:13   ` Lee Jones
2014-03-18  9:11 ` [PATCH v4 1/3] mfd: Add support for S2MPA01 device Lee Jones
2014-03-18 11:09 ` [GIT PULL] mfd: regulator: S2MPA01 device support IB for Mark Brown Lee Jones
2014-03-18 13:10   ` Krzysztof Kozlowski
2014-03-18 13:11   ` Krzysztof Kozlowski [this message]
2014-03-19  8:27     ` [PATCH] mfd: sec-core: Fix uninitialized 'regmap_rtc' on S2MPA01 Sachin Kamat
2014-03-19  8:41       ` Krzysztof Kozlowski
2014-04-06 13:23       ` Geert Uytterhoeven
2014-03-19  9:14     ` Lee Jones
2014-03-19 12:41       ` Krzysztof Kozlowski
2014-03-19 12:55   ` [GIT PULL] mfd: regulator: S2MPA01 device support IB for Mark Brown Mark Brown
2014-03-19 13:47     ` Lee Jones

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1395148286-32002-1-git-send-email-k.kozlowski@samsung.com \
    --to=k.kozlowski@samsung.com \
    --cc=broonie@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=lee.jones@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sachin.kamat@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®