Commit 2a5239b6 authored by Andy Shevchenko's avatar Andy Shevchenko Committed by Jonathan Cameron

iio: magnetometer: tmag5273: Switch to device_property_match_property_string()

Replace open coded device_property_match_property_string().
Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20230808162800.61651-6-andriy.shevchenko@linux.intel.comSigned-off-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
parent f993267a
...@@ -497,17 +497,13 @@ static int tmag5273_set_operating_mode(struct tmag5273_data *data, ...@@ -497,17 +497,13 @@ static int tmag5273_set_operating_mode(struct tmag5273_data *data,
static void tmag5273_read_device_property(struct tmag5273_data *data) static void tmag5273_read_device_property(struct tmag5273_data *data)
{ {
struct device *dev = data->dev; struct device *dev = data->dev;
const char *str;
int ret; int ret;
data->angle_measurement = TMAG5273_ANGLE_EN_X_Y; data->angle_measurement = TMAG5273_ANGLE_EN_X_Y;
ret = device_property_read_string(dev, "ti,angle-measurement", &str); ret = device_property_match_property_string(dev, "ti,angle-measurement",
if (ret) tmag5273_angle_names,
return; ARRAY_SIZE(tmag5273_angle_names));
ret = match_string(tmag5273_angle_names,
ARRAY_SIZE(tmag5273_angle_names), str);
if (ret >= 0) if (ret >= 0)
data->angle_measurement = ret; data->angle_measurement = ret;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment