Re: [PATCH v2 2/2] regulator: check that dummy regulator has been probed before using it

From: Christian Eggers
Date: Thu Mar 13 2025 - 03:40:52 EST


On Thursday, 13 March 2025, 01:46:43 CET, Doug Anderson wrote:
> Hi,
>
> On Tue, Mar 11, 2025 at 2:18 AM Christian Eggers <ceggers@xxxxxxx> wrote:
> >
> > @@ -2213,6 +2221,8 @@ struct regulator *_regulator_get_common(struct regulator_dev *rdev, struct devic
> > */
> > dev_warn(dev, "supply %s not found, using dummy regulator\n", id);
> > rdev = dummy_regulator_rdev;
> > + if (!rdev)
> > + return ERR_PTR(-EPROBE_DEFER);
>
> nit: it feels like the dev_warn() above should be below your new
> check. Otherwise you'll get the same message again after the deferral
> processes.
>

I actually had a similar feeling during making the change. Having entropy on warning
messages isn't very nice, so I'll send a v3.

regards
Christian