]> git.openfabrics.org - ~shefty/rdma-dev.git/commitdiff
regulator: gpio-regulator: Add ifdef CONFIG_OF guard for regulator_gpio_of_match
authorAxel Lin <axel.lin@ingics.com>
Tue, 4 Dec 2012 02:32:05 +0000 (10:32 +0800)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Thu, 6 Dec 2012 06:22:52 +0000 (15:22 +0900)
Use of_match_ptr and add ifdef CONFIG_OF guard for regulator_gpio_of_match.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
drivers/regulator/gpio-regulator.c

index dc9260545b801a7632e25b2c2658beda5897b231..8c4e237394942441f809fd62546b67ff8e0901ca 100644 (file)
@@ -364,10 +364,12 @@ static int __devexit gpio_regulator_remove(struct platform_device *pdev)
        return 0;
 }
 
+#if defined(CONFIG_OF)
 static const struct of_device_id regulator_gpio_of_match[] __devinitconst = {
        { .compatible = "regulator-gpio", },
        {},
 };
+#endif
 
 static struct platform_driver gpio_regulator_driver = {
        .probe          = gpio_regulator_probe,
@@ -375,7 +377,7 @@ static struct platform_driver gpio_regulator_driver = {
        .driver         = {
                .name           = "gpio-regulator",
                .owner          = THIS_MODULE,
-               .of_match_table = regulator_gpio_of_match,
+               .of_match_table = of_match_ptr(regulator_gpio_of_match),
        },
 };