Skip to content

Commit

Permalink
Merge tag 'iio-fixes-for-4.11b' of git://git.kernel.org/pub/scm/linux…
Browse files Browse the repository at this point in the history
…/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.
  • Loading branch information
Greg Kroah-Hartman committed Feb 26, 2017
2 parents bc49a78 + ca1c39e commit 7aa2a92
Showing 3 changed files with 7 additions and 5 deletions.
4 changes: 3 additions & 1 deletion drivers/iio/adc/rcar-gyroadc.c
Original file line number Diff line number Diff line change
@@ -336,7 +336,7 @@ static int rcar_gyroadc_parse_subdevs(struct iio_dev *indio_dev)
struct device_node *child;
struct regulator *vref;
unsigned int reg;
unsigned int adcmode, childmode;
unsigned int adcmode = -1, childmode;
unsigned int sample_width;
unsigned int num_channels;
int ret, first = 1;
@@ -366,6 +366,8 @@ static int rcar_gyroadc_parse_subdevs(struct iio_dev *indio_dev)
channels = rcar_gyroadc_iio_channels_3;
num_channels = ARRAY_SIZE(rcar_gyroadc_iio_channels_3);
break;
default:
return -EINVAL;
}

/*
6 changes: 3 additions & 3 deletions drivers/iio/adc/xilinx-xadc-core.c
Original file line number Diff line number Diff line change
@@ -1208,7 +1208,7 @@ static int xadc_probe(struct platform_device *pdev)

ret = xadc->ops->setup(pdev, indio_dev, irq);
if (ret)
goto err_free_samplerate_trigger;
goto err_clk_disable_unprepare;

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

err_free_irq:
free_irq(irq, indio_dev);
err_clk_disable_unprepare:
clk_disable_unprepare(xadc->clk);
err_free_samplerate_trigger:
if (xadc->ops->flags & XADC_FLAGS_BUFFERED)
iio_trigger_free(xadc->samplerate_trigger);
@@ -1277,8 +1279,6 @@ static int xadc_probe(struct platform_device *pdev)
err_triggered_buffer_cleanup:
if (xadc->ops->flags & XADC_FLAGS_BUFFERED)
iio_triggered_buffer_cleanup(indio_dev);
err_clk_disable_unprepare:
clk_disable_unprepare(xadc->clk);
err_device_free:
kfree(indio_dev->channels);

2 changes: 1 addition & 1 deletion drivers/iio/counter/104-quad-8.c
Original file line number Diff line number Diff line change
@@ -76,7 +76,7 @@ static int quad8_read_raw(struct iio_dev *indio_dev,
return IIO_VAL_INT;
}

flags = inb(base_offset);
flags = inb(base_offset + 1);
borrow = flags & BIT(0);
carry = !!(flags & BIT(1));

0 comments on commit 7aa2a92

Please sign in to comment.