Re: [PATCH 1/1] mmc: core: Use dev_err_probe for deferred regulators

From: Ulf Hansson
Date: Fri Sep 13 2024 - 08:13:38 EST


On Wed, 11 Sept 2024 at 11:09, Alexander Stein
<alexander.stein@xxxxxxxxxxxxxxx> wrote:
>
> In case vmmc or vqmmc regulator is not available yet, use dev_err_probe
> in order to set a deferred probe reason. This is a helpful hint in
> /sys/kernel/debug/devices_deferred
>
> Signed-off-by: Alexander Stein <alexander.stein@xxxxxxxxxxxxxxx>

Applied for next, thanks!

Kind regards
Uffe


> ---
> drivers/mmc/core/regulator.c | 8 ++++++--
> 1 file changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/mmc/core/regulator.c b/drivers/mmc/core/regulator.c
> index 005247a49e51b..01747ab1024ec 100644
> --- a/drivers/mmc/core/regulator.c
> +++ b/drivers/mmc/core/regulator.c
> @@ -255,7 +255,9 @@ int mmc_regulator_get_supply(struct mmc_host *mmc)
>
> if (IS_ERR(mmc->supply.vmmc)) {
> if (PTR_ERR(mmc->supply.vmmc) == -EPROBE_DEFER)
> - return -EPROBE_DEFER;
> + return dev_err_probe(dev, -EPROBE_DEFER,
> + "vmmc regulator not available\n");
> +
> dev_dbg(dev, "No vmmc regulator found\n");
> } else {
> ret = mmc_regulator_get_ocrmask(mmc->supply.vmmc);
> @@ -267,7 +269,9 @@ int mmc_regulator_get_supply(struct mmc_host *mmc)
>
> if (IS_ERR(mmc->supply.vqmmc)) {
> if (PTR_ERR(mmc->supply.vqmmc) == -EPROBE_DEFER)
> - return -EPROBE_DEFER;
> + return dev_err_probe(dev, -EPROBE_DEFER,
> + "vqmmc regulator not available\n");
> +
> dev_dbg(dev, "No vqmmc regulator found\n");
> }
>
> --
> 2.34.1
>