Skip to content

Commit 1fce47a

Browse files
andy-shevjic23
authored andcommitted
iio: magnetometer: tmag5273: Switch to device_property_match_property_string()
Replace open coded device_property_match_property_string(). Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://lore.kernel.org/r/20230808162800.61651-6-andriy.shevchenko@linux.intel.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
1 parent 7cd37d4 commit 1fce47a

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

drivers/iio/magnetometer/tmag5273.c

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -497,17 +497,13 @@ static int tmag5273_set_operating_mode(struct tmag5273_data *data,
497497
static void tmag5273_read_device_property(struct tmag5273_data *data)
498498
{
499499
struct device *dev = data->dev;
500-
const char *str;
501500
int ret;
502501

503502
data->angle_measurement = TMAG5273_ANGLE_EN_X_Y;
504503

505-
ret = device_property_read_string(dev, "ti,angle-measurement", &str);
506-
if (ret)
507-
return;
508-
509-
ret = match_string(tmag5273_angle_names,
510-
ARRAY_SIZE(tmag5273_angle_names), str);
504+
ret = device_property_match_property_string(dev, "ti,angle-measurement",
505+
tmag5273_angle_names,
506+
ARRAY_SIZE(tmag5273_angle_names));
511507
if (ret >= 0)
512508
data->angle_measurement = ret;
513509
}

0 commit comments

Comments
 (0)