]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
regulator: tps65218: Add OF dependency
authorAxel Lin <axel.lin@ingics.com>
Wed, 19 Feb 2014 08:35:03 +0000 (16:35 +0800)
committerMark Brown <broonie@linaro.org>
Wed, 19 Feb 2014 12:18:58 +0000 (21:18 +0900)
This is a DT-only driver, so make it depend on OF and remove of_match_ptr in
the code.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Acked-by: Keerthy <j-keerthy@ti.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
drivers/regulator/Kconfig
drivers/regulator/tps65218-regulator.c

index b05da8803bd1a01e526b280d0762a4703a606f56..b7c95e8d8a0ea15e24b098daf546f84b010f4713 100644 (file)
@@ -515,7 +515,7 @@ config REGULATOR_TPS65217
 
 config REGULATOR_TPS65218
        tristate "TI TPS65218 Power regulators"
-       depends on MFD_TPS65218
+       depends on MFD_TPS65218 && OF
        help
          This driver supports TPS65218 voltage regulator chips. TPS65218
          provides six step-down converters and one general-purpose LDO
index 1fb1db551ec9db70bf073cd8a05712f6849cecc4..cec72fa71d1df192713bb22dcc017c76ac19fc80 100644 (file)
@@ -243,14 +243,12 @@ static int tps65218_regulator_probe(struct platform_device *pdev)
        int id;
 
        match = of_match_device(tps65218_of_match, &pdev->dev);
-       if (match) {
-               template = match->data;
-               id = template->id;
-               init_data = of_get_regulator_init_data(&pdev->dev,
-                                                     pdev->dev.of_node);
-       } else {
+       if (!match)
                return -ENODEV;
-       }
+
+       template = match->data;
+       id = template->id;
+       init_data = of_get_regulator_init_data(&pdev->dev, pdev->dev.of_node);
 
        platform_set_drvdata(pdev, tps);
 
@@ -274,7 +272,7 @@ static struct platform_driver tps65218_regulator_driver = {
        .driver = {
                .name = "tps65218-pmic",
                .owner = THIS_MODULE,
-               .of_match_table = of_match_ptr(tps65218_of_match),
+               .of_match_table = tps65218_of_match,
        },
        .probe = tps65218_regulator_probe,
 };