Re: [PATCH] regulator: bd71815: include <linux/of.h> and <linux/gpio/consumer.h>
From: Matti Vaittinen
Date: Fri Apr 23 2021 - 01:11:14 EST
On Thu, 2021-04-22 at 15:33 +0200, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@xxxxxxxx>
>
> 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.
> 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")
> Signed-off-by: Arnd Bergmann <arnd@xxxxxxxx>
> ---
> 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(-)
>
> diff --git a/drivers/regulator/bd71815-regulator.c
> b/drivers/regulator/bd71815-regulator.c
> index a4e8d5e36b40..5be2b01632a0 100644
> --- a/drivers/regulator/bd71815-regulator.c
> +++ b/drivers/regulator/bd71815-regulator.c
> @@ -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 {