diff options
| -rw-r--r-- | drivers/regulator/Kconfig | 2 | ||||
| -rw-r--r-- | drivers/regulator/tps65218-regulator.c | 14 |
2 files changed, 7 insertions, 9 deletions
diff --git a/drivers/regulator/Kconfig b/drivers/regulator/Kconfig index b05da8803bd1..b7c95e8d8a0e 100644 --- a/drivers/regulator/Kconfig +++ b/drivers/regulator/Kconfig | |||
| @@ -515,7 +515,7 @@ config REGULATOR_TPS65217 | |||
| 515 | 515 | ||
| 516 | config REGULATOR_TPS65218 | 516 | config REGULATOR_TPS65218 |
| 517 | tristate "TI TPS65218 Power regulators" | 517 | tristate "TI TPS65218 Power regulators" |
| 518 | depends on MFD_TPS65218 | 518 | depends on MFD_TPS65218 && OF |
| 519 | help | 519 | help |
| 520 | This driver supports TPS65218 voltage regulator chips. TPS65218 | 520 | This driver supports TPS65218 voltage regulator chips. TPS65218 |
| 521 | provides six step-down converters and one general-purpose LDO | 521 | provides six step-down converters and one general-purpose LDO |
diff --git a/drivers/regulator/tps65218-regulator.c b/drivers/regulator/tps65218-regulator.c index 1fb1db551ec9..cec72fa71d1d 100644 --- a/drivers/regulator/tps65218-regulator.c +++ b/drivers/regulator/tps65218-regulator.c | |||
| @@ -243,14 +243,12 @@ static int tps65218_regulator_probe(struct platform_device *pdev) | |||
| 243 | int id; | 243 | int id; |
| 244 | 244 | ||
| 245 | match = of_match_device(tps65218_of_match, &pdev->dev); | 245 | match = of_match_device(tps65218_of_match, &pdev->dev); |
| 246 | if (match) { | 246 | if (!match) |
| 247 | template = match->data; | ||
| 248 | id = template->id; | ||
| 249 | init_data = of_get_regulator_init_data(&pdev->dev, | ||
| 250 | pdev->dev.of_node); | ||
| 251 | } else { | ||
| 252 | return -ENODEV; | 247 | return -ENODEV; |
| 253 | } | 248 | |
| 249 | template = match->data; | ||
| 250 | id = template->id; | ||
| 251 | init_data = of_get_regulator_init_data(&pdev->dev, pdev->dev.of_node); | ||
| 254 | 252 | ||
| 255 | platform_set_drvdata(pdev, tps); | 253 | platform_set_drvdata(pdev, tps); |
| 256 | 254 | ||
| @@ -274,7 +272,7 @@ static struct platform_driver tps65218_regulator_driver = { | |||
| 274 | .driver = { | 272 | .driver = { |
| 275 | .name = "tps65218-pmic", | 273 | .name = "tps65218-pmic", |
| 276 | .owner = THIS_MODULE, | 274 | .owner = THIS_MODULE, |
| 277 | .of_match_table = of_match_ptr(tps65218_of_match), | 275 | .of_match_table = tps65218_of_match, |
| 278 | }, | 276 | }, |
| 279 | .probe = tps65218_regulator_probe, | 277 | .probe = tps65218_regulator_probe, |
| 280 | }; | 278 | }; |
