aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/regulator/max8907-regulator.c
diff options
context:
space:
mode:
authorStephen Warren <swarren@nvidia.com>2012-08-20 11:39:10 -0400
committerMark Brown <broonie@opensource.wolfsonmicro.com>2012-08-28 14:00:29 -0400
commitdb55168265699c72e6ebf7a4228029da590a3eab (patch)
treecd3d9957c99cb972d94d2e545b4cd2a686c12b57 /drivers/regulator/max8907-regulator.c
parent0764ef59161a4026c44ca184b7812383feabb769 (diff)
regulator: max8907: fix compile error when !CONFIG_OF
Fix the following: CC [M] drivers/regulator/max8907-regulator.o drivers/regulator/max8907-regulator.c: In function 'max8907_regulator_probe': drivers/regulator/max8907-regulator.c:297:12: error: 'max8907_matches' undeclared (first use in this function) by removing direct references to max8907_matches[], which only exists when CONFIG_OF is defined. Signed-off-by: Stephen Warren <swarren@nvidia.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'drivers/regulator/max8907-regulator.c')
-rw-r--r--drivers/regulator/max8907-regulator.c24
1 files changed, 22 insertions, 2 deletions
diff --git a/drivers/regulator/max8907-regulator.c b/drivers/regulator/max8907-regulator.c
index bddc3146c924..3a5104f6eed4 100644
--- a/drivers/regulator/max8907-regulator.c
+++ b/drivers/regulator/max8907-regulator.c
@@ -248,11 +248,31 @@ static int max8907_regulator_parse_dt(struct platform_device *pdev)
248 248
249 return 0; 249 return 0;
250} 250}
251
252static inline struct regulator_init_data *match_init_data(int index)
253{
254 return max8907_matches[index].init_data;
255}
256
257static inline struct device_node *match_of_node(int index)
258{
259 return max8907_matches[index].of_node;
260}
251#else 261#else
252static int max8907_regulator_parse_dt(struct platform_device *pdev) 262static int max8907_regulator_parse_dt(struct platform_device *pdev)
253{ 263{
254 return 0; 264 return 0;
255} 265}
266
267static inline struct regulator_init_data *match_init_data(int index)
268{
269 return NULL;
270}
271
272static inline struct device_node *match_of_node(int index)
273{
274 return NULL;
275}
256#endif 276#endif
257 277
258static __devinit int max8907_regulator_probe(struct platform_device *pdev) 278static __devinit int max8907_regulator_probe(struct platform_device *pdev)
@@ -295,11 +315,11 @@ static __devinit int max8907_regulator_probe(struct platform_device *pdev)
295 if (pdata) 315 if (pdata)
296 idata = pdata->init_data[i]; 316 idata = pdata->init_data[i];
297 else 317 else
298 idata = max8907_matches[i].init_data; 318 idata = match_init_data(i);
299 config.init_data = idata; 319 config.init_data = idata;
300 config.driver_data = pmic; 320 config.driver_data = pmic;
301 config.regmap = max8907->regmap_gen; 321 config.regmap = max8907->regmap_gen;
302 config.of_node = max8907_matches[i].of_node; 322 config.of_node = match_of_node(i);
303 323
304 switch (pmic->desc[i].id) { 324 switch (pmic->desc[i].id) {
305 case MAX8907_MBATT: 325 case MAX8907_MBATT: