Commit 7aa2a92c authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

Merge tag 'iio-fixes-for-4.11b' of...

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.
parents bc49a783 ca1c39ef
......@@ -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;
}
/*
......
......@@ -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);
......
......@@ -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));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment