Skip to contentSkip to conversation

regulator: bd71815: include <linux/of.h> and <linux/gpio/consumer.h>

PATCH In review Arnd Bergmann 2 participants 2 messages Apr 22, 2021 – Apr 23, 2021

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 regulator: bd71815: include <linux/of.h> and <linux/gpio/consumer.h>

From: Arnd Bergmann <[email protected]>

The new driver causes a build failure because of a missing includes:

drivers/regulator/bd71815-regulator.c: In function 'buck12_set_hw_dvs_levels':
drivers/regulator/bd71815-regulator.c:210:13: error: implicit declaration of function 'of_find_property' [-Werror=implicit-function-declaration]
210 | if (of_find_property(np, "rohm,dvs-run-voltage", NULL) ||

      |             ^~~~~~~~~~~~~~~~
drivers/regulator/bd71815-regulator.c: At top level:
drivers/regulator/bd71815-regulator.c:461:37: error: implicit declaration of function 'of_match_ptr' [-Werror=implicit-function-declaration]
  461 |                         .of_match = of_match_ptr(#_name),               \
      |                                     ^~~~~~~~~~~~
drivers/regulator/bd71815-regulator.c: In function 'bd7181x_probe':
drivers/regulator/bd71815-regulator.c:590:19: error: implicit declaration of function 'devm_gpiod_get_from_of_node' [-Werror=implicit-function-declaration]
  590 |         ldo4_en = devm_gpiod_get_from_of_node(&pdev->dev,
      |                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/regulator/bd71815-regulator.c:593:50: error: 'GPIOD_ASIS' undeclared (first use in this function); did you mean 'GPIOF_IN'?
  593 |                                                  GPIOD_ASIS, "ldo4-en");
      |                                                  ^~~~~~~~~~
      |                                                  GPIOF_IN
Fixes 1aad39001e85 ("regulator: Support ROHM BD71815 regulators")

---
As found yesterday with another patch I sent for this driver, it is apparently not part of the regulator tree but only merged through Lee's mfd tree.

---
 drivers/regulator/bd71815-regulator.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/regulator/bd71815-regulator.c +2 -1
index a4e8d5e36b40..5be2b01632a0 100644
@@ -16,9 +16,10 @@
 #include <linux/regulator/driver.h>
 #include <linux/delay.h>
 #include <linux/slab.h>
-#include <linux/gpio.h>
+#include <linux/gpio/consumer.h>
 #include <linux/mfd/rohm-generic.h>
 #include <linux/mfd/rohm-bd71815.h>
+#include <linux/of.h>
 #include <linux/regulator/of_regulator.h>
 
 struct bd71815_regulator {
Signature · 1 line
2.29.2
#1 lore raw
Quoted 3 lines · Arnd Bergmann

From: Arnd Bergmann <[email protected]>

The new driver causes a build failure because of a missing includes:

Odd that I never saw these errors. Thanks for the fix anyways! Much appreciated.

Quoted 55 lines

drivers/regulator/bd71815-regulator.c: In function 'buck12_set_hw_dvs_levels':
drivers/regulator/bd71815-regulator.c:210:13: error: implicit declaration of function 'of_find_property' [-Werror=implicit- function-declaration]

  210 |         if (of_find_property(np, "rohm,dvs-run-voltage",
NULL) ||
      |             ^~~~~~~~~~~~~~~~

drivers/regulator/bd71815-regulator.c: At top level:
drivers/regulator/bd71815-regulator.c:461:37: error: implicit declaration of function 'of_match_ptr' [-Werror=implicit-function- declaration]
461 | .of_match =

of_match_ptr(#_name),               \
      |                                     ^~~~~~~~~~~~

drivers/regulator/bd71815-regulator.c: In function 'bd7181x_probe':
drivers/regulator/bd71815-regulator.c:590:19: error: implicit declaration of function 'devm_gpiod_get_from_of_node' [- Werror=implicit-function-declaration]
590 | ldo4_en = devm_gpiod_get_from_of_node(&pdev->dev,

      |                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~

drivers/regulator/bd71815-regulator.c:593:50: error: 'GPIOD_ASIS' undeclared (first use in this function); did you mean 'GPIOF_IN'?
593 | GPIOD_ASIS,
"ldo4-en");

      |                                                  ^~~~~~~~~~
      |                                                  GPIOF_IN
Fixes 1aad39001e85 ("regulator: Support ROHM BD71815 regulators")

---
As found yesterday with another patch I sent for this driver, it is apparently not part of the regulator tree but only merged through Lee's mfd tree.

---
 drivers/regulator/bd71815-regulator.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/regulator/bd71815-regulator.c +2 -1
index a4e8d5e36b40..5be2b01632a0 100644
@@ -16,9 +16,10 @@
 #include <linux/regulator/driver.h>
 #include <linux/delay.h>
 #include <linux/slab.h>
-#include <linux/gpio.h>
+#include <linux/gpio/consumer.h>
 #include <linux/mfd/rohm-generic.h>
 #include <linux/mfd/rohm-bd71815.h>
+#include <linux/of.h>
 #include <linux/regulator/of_regulator.h>
 
 struct bd71815_regulator {