Skip to content

Commit 7aa2a92

Browse files
committed
Merge tag 'iio-fixes-for-4.11b' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-linus
Jonathan writes: Second set of IIO fixes for IIO in the 4.11 cycle. This series consists of fixes that either came in after the merge window had opened or are fixes for work that merged during the merge window so had to wait for that to hit mainline. * 104-quad-8 - Fix an off by one error in the register address for the flag register. * rcar-gyroadc - protect against possible issues in future by dealing with childmode not being in a valid state. This also deals with some build warnings. * xilinx - fix some error handling paths to ensure resources are released in reverse order of being acquired.
2 parents bc49a78 + ca1c39e commit 7aa2a92

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

drivers/iio/adc/rcar-gyroadc.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ static int rcar_gyroadc_parse_subdevs(struct iio_dev *indio_dev)
336336
struct device_node *child;
337337
struct regulator *vref;
338338
unsigned int reg;
339-
unsigned int adcmode, childmode;
339+
unsigned int adcmode = -1, childmode;
340340
unsigned int sample_width;
341341
unsigned int num_channels;
342342
int ret, first = 1;
@@ -366,6 +366,8 @@ static int rcar_gyroadc_parse_subdevs(struct iio_dev *indio_dev)
366366
channels = rcar_gyroadc_iio_channels_3;
367367
num_channels = ARRAY_SIZE(rcar_gyroadc_iio_channels_3);
368368
break;
369+
default:
370+
return -EINVAL;
369371
}
370372

371373
/*

drivers/iio/adc/xilinx-xadc-core.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1208,7 +1208,7 @@ static int xadc_probe(struct platform_device *pdev)
12081208

12091209
ret = xadc->ops->setup(pdev, indio_dev, irq);
12101210
if (ret)
1211-
goto err_free_samplerate_trigger;
1211+
goto err_clk_disable_unprepare;
12121212

12131213
ret = request_irq(irq, xadc->ops->interrupt_handler, 0,
12141214
dev_name(&pdev->dev), indio_dev);
@@ -1268,6 +1268,8 @@ static int xadc_probe(struct platform_device *pdev)
12681268

12691269
err_free_irq:
12701270
free_irq(irq, indio_dev);
1271+
err_clk_disable_unprepare:
1272+
clk_disable_unprepare(xadc->clk);
12711273
err_free_samplerate_trigger:
12721274
if (xadc->ops->flags & XADC_FLAGS_BUFFERED)
12731275
iio_trigger_free(xadc->samplerate_trigger);
@@ -1277,8 +1279,6 @@ static int xadc_probe(struct platform_device *pdev)
12771279
err_triggered_buffer_cleanup:
12781280
if (xadc->ops->flags & XADC_FLAGS_BUFFERED)
12791281
iio_triggered_buffer_cleanup(indio_dev);
1280-
err_clk_disable_unprepare:
1281-
clk_disable_unprepare(xadc->clk);
12821282
err_device_free:
12831283
kfree(indio_dev->channels);
12841284

drivers/iio/counter/104-quad-8.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ static int quad8_read_raw(struct iio_dev *indio_dev,
7676
return IIO_VAL_INT;
7777
}
7878

79-
flags = inb(base_offset);
79+
flags = inb(base_offset + 1);
8080
borrow = flags & BIT(0);
8181
carry = !!(flags & BIT(1));
8282

0 commit comments

Comments
 (0)