Skip to content

Commit 0619362

Browse files
mhennerichgastmaier
authored andcommitted
iio: adc: ad9081: Remove unreachable sample rate setting code
The sample rate configuration logic following the call to ad9081_set_sample_rate() was unreachable due to an early return. This patch removes the dead code block that attempted to round and set the clock rate, which is now obsolete and no longer executed. Cleaning up this unreachable code improves readability and avoids confusion about the actual sample rate handling path. Signed-off-by: Michael Hennerich <[email protected]> (cherry picked from commit 169dfdb)
1 parent 5cc342d commit 0619362

File tree

1 file changed

+0
-13
lines changed

1 file changed

+0
-13
lines changed

drivers/iio/adc/ad9081.c

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2682,7 +2682,6 @@ static int ad9081_write_raw(struct iio_dev *indio_dev,
26822682
{
26832683
struct axiadc_converter *conv = iio_device_get_drvdata(indio_dev);
26842684
struct ad9081_phy *phy = conv->phy;
2685-
unsigned long r_clk;
26862685
int ret;
26872686

26882687
guard(mutex)(&conv->lock);
@@ -2699,18 +2698,6 @@ static int ad9081_write_raw(struct iio_dev *indio_dev,
26992698
return -EPERM;
27002699

27012700
return ad9081_set_sample_rate(conv, val);
2702-
2703-
r_clk = clk_round_rate(conv->clk, val);
2704-
if (r_clk < 0 || r_clk > conv->chip_info->max_rate) {
2705-
dev_warn(&conv->spi->dev,
2706-
"Error setting ADC sample rate %ld", r_clk);
2707-
return -EINVAL;
2708-
}
2709-
2710-
ret = clk_set_rate(conv->clk, r_clk);
2711-
if (ret < 0)
2712-
return ret;
2713-
break;
27142701
case IIO_CHAN_INFO_ENABLE:
27152702
if (chan->output) {
27162703
u8 cddc_num, cddc_mask, fddc_num, fddc_mask;

0 commit comments

Comments
 (0)