Re: [PATCH v4 3/3] iio: magnetometer: add ti tmag5273 driver

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

 



On Tue, Nov 29, 2022 at 06:37:42PM +0200, Andy Shevchenko wrote:
> On Tue, Nov 29, 2022 at 07:45:40AM +0100, Gerald Loacker wrote:

...

> > +	ret = match_string(tmag5273_angle_names,
> > +			   ARRAY_SIZE(tmag5273_angle_names), str);
> > +	if (ret < 0)
> > +		dev_warn(dev, "unexpected read angle-measurement property: %s\n", str);
> 
> 		dev_warn(dev, "unexpected value in angle-measurement property: %s\n", str);
> 
> ?
> 
> > +	else
> > +		data->angle_measurement = ret;

Actually remembering Rob's statement that Linux should not validate device
tree, this can be written rather as:

	ret = match_string(tmag5273_angle_names,
			   ARRAY_SIZE(tmag5273_angle_names), str);
	if (ret >= 0)
		data->angle_measurement = ret;

-- 
With Best Regards,
Andy Shevchenko





[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