diff mbox series

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

Message ID 20240911090910.3060749-1-alexander.stein@ew.tq-group.com (mailing list archive)
State New
Headers show
Series [1/1] mmc: core: Use dev_err_probe for deferred regulators | expand

Commit Message

Alexander Stein Sept. 11, 2024, 9:09 a.m. UTC
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@ew.tq-group.com>
---
 drivers/mmc/core/regulator.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

Comments

Ulf Hansson Sept. 13, 2024, 12:12 p.m. UTC | #1
On Wed, 11 Sept 2024 at 11:09, Alexander Stein
<alexander.stein@ew.tq-group.com> 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@ew.tq-group.com>

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
>
diff mbox series

Patch

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");
 	}