Re: [PATCH 2/2] iio: pressure: driver for Honeywell HSC/SSC series pressure sensors

From: Jonathan Cameron
Date: Sat Nov 25 2023 - 14:15:41 EST


>
> > > > + ret = devm_regulator_get_enable_optional(dev, "vdd");
> > > > + if (ret == -EPROBE_DEFER)
> > > > + return -EPROBE_DEFER;
> > >
> > > Oh, boy, this should check for ENODEV or so, yeah, regulator APIs a bit
> > > interesting.
> >
> > since I'm unable to test this I'd rather remove the block altogether.
> > if I go the ENODEV route my module will never load since I can't see any
> > vdd-supply support on my devboard.
>
> No, what I meant is to have something like
>
> if (ret) {
> if (ret != -ENODEV)
> return ret;
> ...regulator is not present...
> }
>
> This is how it's being used in dozens of places in the kernel. Just utilize
> `git grep ...` which should be a top-10 tool for the Linux kernel developer.

As per my very late reply to previous email. Nope. This regulator is never
not present. It's just a question of whether the firmware tells us what
it is, or it is supplied with a stub regulator.