[PATCH V2 2/4] regulator: bd718x7: Only bind children when PMIC_CHILDREN is enabled
sbabic at denx.de
sbabic at denx.de
Tue Nov 8 17:38:48 CET 2022
> If the bd718x7 is required, but PMIC_CHILDREN is disabled, this
> driver throws a compile error. Fix this by putting the function
> to bind children into an if-statement checking for PMIC_CHILDREN.
> Allowing PMIC_CHILDREN to be disabled in SPL saves some space and
> still permits some read/write functions to access the PMIC in
> early startup.
> Signed-off-by: Adam Ford <aford173 at gmail.com>
> Reviewed-by: Simon Glass <sjg at chromium.org>
> Reviewed-by: Fabio Estevam <festevam at gmail.com>
> diff --git a/drivers/power/pmic/bd71837.c b/drivers/power/pmic/bd71837.c
> index cb9238972f..fdbbd6f559 100644
> --- a/drivers/power/pmic/bd71837.c
> +++ b/drivers/power/pmic/bd71837.c
> @@ -63,10 +63,11 @@ static int bd71837_bind(struct udevice *dev)
>
> debug("%s: '%s' - found regulators subnode\n", __func__, dev->name);
>
> - children = pmic_bind_children(dev, regulators_node, pmic_children_info);
> - if (!children)
> - debug("%s: %s - no child found\n", __func__, dev->name);
> -
> + if (CONFIG_IS_ENABLED(PMIC_CHILDREN)) {
> + children = pmic_bind_children(dev, regulators_node, pmic_children_info);
> + if (!children)
> + debug("%s: %s - no child found\n", __func__, dev->name);
> + }
> /* Always return success for this device */
> return 0;
> }
Applied to u-boot-imx, master, thanks !
Best regards,
Stefano Babic
--
=====================================================================
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================
More information about the U-Boot
mailing list