From: Krzysztof Kozlowski <k.kozlowski@samsung.com>
To: Samuel Ortiz <sameo@linux.intel.com>,
Lee Jones <lee.jones@linaro.org>,
Liam Girdwood <lgirdwood@gmail.com>,
Mark Brown <broonie@kernel.org>,
linux-kernel@vger.kernel.org
Cc: Kyungmin Park <kyungmin.park@samsung.com>,
Marek Szyprowski <m.szyprowski@samsung.com>,
Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>,
Javier Martinez Canillas <javier.martinez@collabora.co.uk>,
Krzysztof Kozlowski <k.kozlowski@samsung.com>
Subject: [PATCH 1/6] regulator: max77686: Consistently index opmode array by rdev id
Date: Tue, 04 Nov 2014 09:49:41 +0100 [thread overview]
Message-ID: <1415090986-30623-2-git-send-email-k.kozlowski@samsung.com> (raw)
In-Reply-To: <1415090986-30623-1-git-send-email-k.kozlowski@samsung.com>
Mixed indexes were used for array of opmodes in max77686_data structure:
id of regulator and index of regulator_desc array.
These indexes are exactly the same but the mixture may confuse. Use
consistently the id of regulator.
Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
---
drivers/regulator/max77686.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/regulator/max77686.c b/drivers/regulator/max77686.c
index 09b0d8c20a9d..27c5f4556044 100644
--- a/drivers/regulator/max77686.c
+++ b/drivers/regulator/max77686.c
@@ -82,6 +82,7 @@ enum max77686_ramp_rate {
};
struct max77686_data {
+ /* Array indexed by regulator id */
unsigned int opmode[MAX77686_REGULATORS];
};
@@ -513,12 +514,13 @@ static int max77686_pmic_probe(struct platform_device *pdev)
for (i = 0; i < MAX77686_REGULATORS; i++) {
struct regulator_dev *rdev;
+ int id = regulators[i].id;
config.init_data = pdata->regulators[i].initdata;
config.of_node = pdata->regulators[i].of_node;
- max77686->opmode[i] = regulators[i].enable_mask >>
- max77686_get_opmode_shift(i);
+ max77686->opmode[id] = regulators[i].enable_mask >>
+ max77686_get_opmode_shift(id);
rdev = devm_regulator_register(&pdev->dev,
®ulators[i], &config);
if (IS_ERR(rdev)) {
--
1.9.1
next prev parent reply other threads:[~2014-11-04 8:50 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-04 8:49 [PATCH 0/6] regulator: max77686/802: Cleanup Krzysztof Kozlowski
2014-11-04 8:49 ` Krzysztof Kozlowski [this message]
2014-11-04 20:41 ` [PATCH 1/6] regulator: max77686: Consistently index opmode array by rdev id Mark Brown
2014-11-04 8:49 ` [PATCH 2/6] regulator: max77686: Initialize opmode explicitly to normal mode Krzysztof Kozlowski
2014-11-04 20:42 ` Mark Brown
2014-11-04 8:49 ` [RFT 3/6] regulator: max77802: Don't ignore return value of current opmode Krzysztof Kozlowski
2014-11-04 20:47 ` Mark Brown
2014-11-04 8:49 ` [RFT 4/6] regulator: max77802: Remove support for board files Krzysztof Kozlowski
2014-11-04 8:49 ` [PATCH 5/6] regulator: max77686: " Krzysztof Kozlowski
2014-11-04 20:46 ` Mark Brown
2014-11-05 8:33 ` Krzysztof Kozlowski
2014-11-04 8:49 ` [PATCH 6/6] mfd: max77686/802: " Krzysztof Kozlowski
2014-11-04 9:24 ` [PATCH 0/6] regulator: max77686/802: Cleanup Javier Martinez Canillas
2014-11-04 9:25 ` Krzysztof Kozlowski
2014-11-04 20:42 ` Mark Brown
2014-11-05 8:34 ` Krzysztof Kozlowski
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=1415090986-30623-2-git-send-email-k.kozlowski@samsung.com \
--to=k.kozlowski@samsung.com \
--cc=b.zolnierkie@samsung.com \
--cc=broonie@kernel.org \
--cc=javier.martinez@collabora.co.uk \
--cc=kyungmin.park@samsung.com \
--cc=lee.jones@linaro.org \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=m.szyprowski@samsung.com \
--cc=sameo@linux.intel.com \
/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;
as well as URLs for NNTP newsgroup(s).