Re: [PATCH v5 2/3] iio: pressure: Honeywell mprls0025pa pressure sensor

From: Jonathan Cameron
Date: Sun Jun 04 2023 - 09:07:52 EST




>
> > + if (dev_fwnode(dev)) {
>
> Why not simply use defaults?

Potential for inconsistent set if a firmware provides some but not others?
(at least that was my assumption that could well be wrong)

>
> > + ret = device_property_read_u32(dev, "honeywell,pmin-pascal",
> > + &data->pmin);
> > + if (ret)
> > + return dev_err_probe(dev, ret,
> > + "honeywell,pmin-pascal could not be read\n");
> > + ret = device_property_read_u32(dev, "honeywell,pmax-pascal",
> > + &data->pmax);
> > + if (ret)
> > + return dev_err_probe(dev, ret,
> > + "honeywell,pmax-pascal could not be read\n");
> > + ret = device_property_read_u32(dev,
> > + "honeywell,transfer-function", &data->function);
> > + if (ret)
> > + return dev_err_probe(dev, ret,
> > + "honeywell,transfer-function could not be read\n");
> > + if (data->function > MPR_FUNCTION_C)
> > + return dev_err_probe(dev, -EINVAL,