regulator: gpio-regulator: Add ifdef CONFIG_OF guard for regulator_gpio_of_match

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>
This commit is contained in:
Axel Lin 2012-12-04 10:32:05 +08:00 committed by Mark Brown
parent 216f2b9c95
commit ec4f7b88b4
1 changed files with 3 additions and 1 deletions

View File

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