diff options
author | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2023-08-08 19:27:57 +0300 |
---|---|---|
committer | Jonathan Cameron <Jonathan.Cameron@huawei.com> | 2023-11-16 19:10:26 +0000 |
commit | 7829a9d75989260744514c1d6ce598ece7804200 (patch) | |
tree | c55b114e4d609684e669944cf97740caa98826b7 | |
parent | fac4a535758851215d23d7d92879aeee5035f51d (diff) | |
download | linux-7829a9d75989260744514c1d6ce598ece7804200.tar.gz linux-7829a9d75989260744514c1d6ce598ece7804200.tar.bz2 linux-7829a9d75989260744514c1d6ce598ece7804200.zip |
iio: frequency: adf4377: 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-4-andriy.shevchenko@linux.intel.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-rw-r--r-- | drivers/iio/frequency/adf4377.c | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/drivers/iio/frequency/adf4377.c b/drivers/iio/frequency/adf4377.c index 26abecbd51e0..9284c13f1abb 100644 --- a/drivers/iio/frequency/adf4377.c +++ b/drivers/iio/frequency/adf4377.c @@ -870,7 +870,6 @@ static const struct iio_chan_spec adf4377_channels[] = { static int adf4377_properties_parse(struct adf4377_state *st) { struct spi_device *spi = st->spi; - const char *str; int ret; st->clkin = devm_clk_get_enabled(&spi->dev, "ref_in"); @@ -896,16 +895,13 @@ static int adf4377_properties_parse(struct adf4377_state *st) return dev_err_probe(&spi->dev, PTR_ERR(st->gpio_enclk2), "failed to get the CE GPIO\n"); - ret = device_property_read_string(&spi->dev, "adi,muxout-select", &str); - if (ret) { - st->muxout_select = ADF4377_MUXOUT_HIGH_Z; - } else { - ret = match_string(adf4377_muxout_modes, ARRAY_SIZE(adf4377_muxout_modes), str); - if (ret < 0) - return ret; - + ret = device_property_match_property_string(&spi->dev, "adi,muxout-select", + adf4377_muxout_modes, + ARRAY_SIZE(adf4377_muxout_modes)); + if (ret >= 0) st->muxout_select = ret; - } + else + st->muxout_select = ADF4377_MUXOUT_HIGH_Z; return 0; } |