Re: [PATCH 4/8] hwmon: (tmp421) add support for defining labels from DT

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Dnia Tue, Sep 07, 2021 at 10:55:52AM -0700, Guenter Roeck napisał(a):
On Tue, Sep 07, 2021 at 07:49:36PM +0200, Krzysztof Adamski wrote:
Dnia Tue, Sep 07, 2021 at 08:46:22AM -0700, Guenter Roeck napisał(a):
> > +void tmp421_probe_child_from_dt(struct i2c_client *client,
> > +				struct device_node *child,
> > +				struct tmp421_data *data)
> > +
> > +{
> > +	struct device *dev = &client->dev;
> > +	u32 i;
> > +	int err;
> > +
> > +	err = of_property_read_u32(child, "reg", &i);
> > +	if (err) {
> > +		dev_err(dev, "missing reg property of %pOFn\n", child);
> > +		return;
>
> Report to caller
>

My idea was to make those errors in DT non-critical. I.e. if one of the
child nodes is not well structured, I just skip it but continue the
probing. Do you think it should be considered critical and I should
abort the whole probe function as soon as I detect such DT errors,
instead?

Yes, I do think so. Otherwise people will just generate bad DT files and
never fix them or even on purpose ignore the error messages. I don't want
to see such messages in a production system.

On a side note, I do not accept dev_err/pr_err if the error is ignored.
Either it is an error, or it isn't.

Makes sense - if it's an error, it should be reported as such, otherwise
it's just a warning.
I'll change the code to fail on DT errors in v2.

Thank you,
Krzysztof



[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux