diff options
author | Axel Lin <axel.lin@ingics.com> | 2013-06-29 12:33:52 -0400 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2013-07-01 06:16:15 -0400 |
commit | 8c7e7ddf31ca9943b70e58d1c47d059beda435bd (patch) | |
tree | efbef0c11233af5954be39e96e8b983d87938026 /drivers/regulator/max77693.c | |
parent | f3ecdd7bf6a782a6eafe9c2c5d39fcb487e2a154 (diff) |
regulator: max77693: Remove NULL test for rmatch[i].init_data
The implementation in of_regulator_match() already ensures match->init_data is
not NULL for all matched cases if the return value of of_regulator_match() > 0.
Thus remove NULL test for rmatch[i].init_data.
This patch also fixes the condition for loop iteration.
The for loop should iterate "matched" times rather than ARRAY_SIZE(regulators)
because we only allocate "matched" number of entries for rdata.
Though in most cases, "matched" == ARRAY_SIZE(regulators).
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Acked-by: Jonghwa Lee <jonghwa3.lee@samsung.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Diffstat (limited to 'drivers/regulator/max77693.c')
-rw-r--r-- | drivers/regulator/max77693.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/regulator/max77693.c b/drivers/regulator/max77693.c index d45a4dd17131..ce4b96c15eba 100644 --- a/drivers/regulator/max77693.c +++ b/drivers/regulator/max77693.c | |||
@@ -190,9 +190,7 @@ static int max77693_pmic_dt_parse_rdata(struct device *dev, | |||
190 | 190 | ||
191 | tmp = *rdata; | 191 | tmp = *rdata; |
192 | 192 | ||
193 | for (i = 0; i < ARRAY_SIZE(regulators); i++) { | 193 | for (i = 0; i < matched; i++) { |
194 | if (!rmatch[i].init_data) | ||
195 | continue; | ||
196 | tmp->initdata = rmatch[i].init_data; | 194 | tmp->initdata = rmatch[i].init_data; |
197 | tmp->of_node = rmatch[i].of_node; | 195 | tmp->of_node = rmatch[i].of_node; |
198 | tmp->id = regulators[i].id; | 196 | tmp->id = regulators[i].id; |