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