summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>2023-08-08 19:27:59 +0300
committerJonathan Cameron <Jonathan.Cameron@huawei.com>2023-11-16 19:10:26 +0000
commit2a5239b6ab8ced2ee9dce34c2d274c98b118be15 (patch)
tree7d6a3d58d5ff3aea854e62d69680d8097fbd843d
parentf993267a723f75df0f2996c4b94e76f2db1598be (diff)
downloadlinux-2a5239b6ab8ced2ee9dce34c2d274c98b118be15.tar.gz
linux-2a5239b6ab8ced2ee9dce34c2d274c98b118be15.tar.bz2
linux-2a5239b6ab8ced2ee9dce34c2d274c98b118be15.zip
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>
-rw-r--r--drivers/iio/magnetometer/tmag5273.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/drivers/iio/magnetometer/tmag5273.c b/drivers/iio/magnetometer/tmag5273.c
index c5e5c4ad681e..bcd989d65059 100644
--- a/drivers/iio/magnetometer/tmag5273.c
+++ b/drivers/iio/magnetometer/tmag5273.c
@@ -497,17 +497,13 @@ static int tmag5273_set_operating_mode(struct tmag5273_data *data,
static void tmag5273_read_device_property(struct tmag5273_data *data)
{
struct device *dev = data->dev;
- const char *str;
int ret;
data->angle_measurement = TMAG5273_ANGLE_EN_X_Y;
- ret = device_property_read_string(dev, "ti,angle-measurement", &str);
- if (ret)
- return;
-
- ret = match_string(tmag5273_angle_names,
- ARRAY_SIZE(tmag5273_angle_names), str);
+ ret = device_property_match_property_string(dev, "ti,angle-measurement",
+ tmag5273_angle_names,
+ ARRAY_SIZE(tmag5273_angle_names));
if (ret >= 0)
data->angle_measurement = ret;
}