diff options
author | Nuno Sa <nuno.sa@analog.com> | 2024-10-09 16:16:45 +0200 |
---|---|---|
committer | Jonathan Cameron <Jonathan.Cameron@huawei.com> | 2024-10-10 19:12:42 +0100 |
commit | eec91fc8aa324428bb9465abca5156628ac7061a (patch) | |
tree | 778cd0e5c7a8f13e50fb4a48612fec0ef0f7580b | |
parent | 17f3d6cef3b7553b8b67ac7a73100fca2d8284cf (diff) |
iio: frequency: adf4371: drop clkin from struct adf4371_state
We already cache clkin rate during probe and then never use the clk
object again. Hence, no point in saving in our global state struct.
Signed-off-by: Nuno Sa <nuno.sa@analog.com>
Link: https://patch.msgid.link/20241009-dev-adf4371-minor-improv-v1-3-97f4f22ed941@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-rw-r--r-- | drivers/iio/frequency/adf4371.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/iio/frequency/adf4371.c b/drivers/iio/frequency/adf4371.c index eb31f442566c..45c8398a45d0 100644 --- a/drivers/iio/frequency/adf4371.c +++ b/drivers/iio/frequency/adf4371.c @@ -158,7 +158,6 @@ struct adf4371_chip_info { struct adf4371_state { struct spi_device *spi; struct regmap *regmap; - struct clk *clkin; /* * Lock for accessing device registers. Some operations require * multiple consecutive R/W operations, during which the device @@ -547,6 +546,7 @@ static int adf4371_probe(struct spi_device *spi) struct iio_dev *indio_dev; struct adf4371_state *st; struct regmap *regmap; + struct clk *clkin; int ret; indio_dev = devm_iio_device_alloc(&spi->dev, sizeof(*st)); @@ -575,11 +575,11 @@ static int adf4371_probe(struct spi_device *spi) indio_dev->channels = st->chip_info->channels; indio_dev->num_channels = st->chip_info->num_channels; - st->clkin = devm_clk_get_enabled(&spi->dev, "clkin"); - if (IS_ERR(st->clkin)) - return PTR_ERR(st->clkin); + clkin = devm_clk_get_enabled(&spi->dev, "clkin"); + if (IS_ERR(clkin)) + return PTR_ERR(clkin); - st->clkin_freq = clk_get_rate(st->clkin); + st->clkin_freq = clk_get_rate(clkin); ret = adf4371_setup(st); if (ret < 0) { |