Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

authored by

Nuno Sa and committed by
Jonathan Cameron
eec91fc8 17f3d6ce

+5 -5
+5 -5
drivers/iio/frequency/adf4371.c
··· 158 158 struct adf4371_state { 159 159 struct spi_device *spi; 160 160 struct regmap *regmap; 161 - struct clk *clkin; 162 161 /* 163 162 * Lock for accessing device registers. Some operations require 164 163 * multiple consecutive R/W operations, during which the device ··· 546 547 struct iio_dev *indio_dev; 547 548 struct adf4371_state *st; 548 549 struct regmap *regmap; 550 + struct clk *clkin; 549 551 int ret; 550 552 551 553 indio_dev = devm_iio_device_alloc(&spi->dev, sizeof(*st)); ··· 575 575 indio_dev->channels = st->chip_info->channels; 576 576 indio_dev->num_channels = st->chip_info->num_channels; 577 577 578 - st->clkin = devm_clk_get_enabled(&spi->dev, "clkin"); 579 - if (IS_ERR(st->clkin)) 580 - return PTR_ERR(st->clkin); 578 + clkin = devm_clk_get_enabled(&spi->dev, "clkin"); 579 + if (IS_ERR(clkin)) 580 + return PTR_ERR(clkin); 581 581 582 - st->clkin_freq = clk_get_rate(st->clkin); 582 + st->clkin_freq = clk_get_rate(clkin); 583 583 584 584 ret = adf4371_setup(st); 585 585 if (ret < 0) {