Skip to contentSkip to conversation

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

PATCH Applied Axel Lin 2 participants 2 messages Dec 4, 2012 – Dec 6, 2012 Voltage and current regulator framework

lore
Share & tools
lore

Axel Lin

author
#0 lore raw

PATCH 1/1 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.

---
 drivers/regulator/gpio-regulator.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/regulator/gpio-regulator.c +3 -1
index 3ee79c8..2cfd9d3 100644
@@ -364,10 +364,12 @@ static int 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),
 	},
 };
 
Signature · 1 line
1.7.9.5
Applied
#1 lore raw
Quoted 1 line · Axel Lin

Use of_match_ptr and add ifdef CONFIG_OF guard for regulator_gpio_of_match.

Applied, thanks.