[PATCH] regulator: ab8500-ext: Don't register without initialisation data
Linus Walleij
linus.walleij at linaro.org
Wed May 22 09:18:01 EDT 2013
On Wed, May 22, 2013 at 2:47 PM, Lee Jones <lee.jones at linaro.org> wrote:
> This patch fixes a bug introduced in the v3.10 merge window.
>
> Some platforms will not want external registers. Rather than setting up
> lots of different clauses in the core ab8500 regulator driver not to
> call ab8500-ext init() we just won't pass the initialisation data from
> platform code. This patch checks for it and if it's missing, we won't
> register the external regulators.
>
> Cc: Mark Brown <broonie at kernel.org>
> Signed-off-by: Lee Jones <lee.jones at linaro.org>
> ---
> drivers/regulator/ab8500-ext.c | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/drivers/regulator/ab8500-ext.c b/drivers/regulator/ab8500-ext.c
> index b4d4547..8421537 100644
> --- a/drivers/regulator/ab8500-ext.c
> +++ b/drivers/regulator/ab8500-ext.c
> @@ -334,6 +334,12 @@ int ab8500_ext_regulator_init(struct platform_device *pdev)
> return -EINVAL;
> }
>
> + /* have any external regulators been specified? */
> + if (pdata->num_ext_regulator == 0) {
> + dev_warn(&pdev->dev, "Not using external regulators\n");
> + return 0;
> + }
dev_warn() is really when we warn about something really nasty, worse
than dev_err(). It seems dev_info() is more apropriate.
Anyway since it's an urgent regression:
Acked-by: Linus Walleij <linus.walleij at linaro.org>
Linus
More information about the linux-arm-kernel
mailing list