diff options
| author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-02-07 11:57:00 -0500 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-02-07 11:57:00 -0500 |
| commit | 81e990bbdeb77db80d7e7f0e36e159a0facfdff0 (patch) | |
| tree | 0ec51a2bcf825c35d524af027237b17cff89a8f3 /drivers/staging | |
| parent | 5a819ed6d4bb803ee609b4ceedd7c8efbbfa65e0 (diff) | |
| parent | 8c314da583c9d5c67fe59aa8c92f94f15cb8de90 (diff) | |
Merge tag 'iio-fixes-for-3.14a' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-linus
Jonathan writes:
First set of IIO fixes for the 3.14 cycle.
Included is the patch previously set as the fourth round for 3.13 which was
to late to be appropriate.
* Another endian fix (ad799x adc) due to missuse of the IIO_ST macro (which
is going away very shortly)
* A reversed error check in ad5933 which will make the probe fail.
* A buffer overflow in the example code in the documentation.
* ad799x was freeing an irq that might or might not have been requested.
* tsl2563 was checking the wrong element of chan_spec for modifiers. Thus some
sysfs reads would give the wrong values.
* A missing dependency on HAS_IOMEM in spear_adc and lpc32xx was causing some
test build failures (on s390 and perhaps elsewhere).
I also have a few fixes queued up for things that went in during the 3.14
merge window which will follow as a separate pull request (to avoid rebasing
my tree).
Diffstat (limited to 'drivers/staging')
| -rw-r--r-- | drivers/staging/iio/Documentation/iio_utils.h | 6 | ||||
| -rw-r--r-- | drivers/staging/iio/adc/ad799x_core.c | 11 | ||||
| -rw-r--r-- | drivers/staging/iio/impedance-analyzer/ad5933.c | 2 |
3 files changed, 13 insertions, 6 deletions
diff --git a/drivers/staging/iio/Documentation/iio_utils.h b/drivers/staging/iio/Documentation/iio_utils.h index 35154d60faf6..c9fedb79e3a2 100644 --- a/drivers/staging/iio/Documentation/iio_utils.h +++ b/drivers/staging/iio/Documentation/iio_utils.h | |||
| @@ -77,7 +77,6 @@ struct iio_channel_info { | |||
| 77 | uint64_t mask; | 77 | uint64_t mask; |
| 78 | unsigned be; | 78 | unsigned be; |
| 79 | unsigned is_signed; | 79 | unsigned is_signed; |
| 80 | unsigned enabled; | ||
| 81 | unsigned location; | 80 | unsigned location; |
| 82 | }; | 81 | }; |
| 83 | 82 | ||
| @@ -335,6 +334,7 @@ inline int build_channel_array(const char *device_dir, | |||
| 335 | while (ent = readdir(dp), ent != NULL) { | 334 | while (ent = readdir(dp), ent != NULL) { |
| 336 | if (strcmp(ent->d_name + strlen(ent->d_name) - strlen("_en"), | 335 | if (strcmp(ent->d_name + strlen(ent->d_name) - strlen("_en"), |
| 337 | "_en") == 0) { | 336 | "_en") == 0) { |
| 337 | int current_enabled = 0; | ||
| 338 | current = &(*ci_array)[count++]; | 338 | current = &(*ci_array)[count++]; |
| 339 | ret = asprintf(&filename, | 339 | ret = asprintf(&filename, |
| 340 | "%s/%s", scan_el_dir, ent->d_name); | 340 | "%s/%s", scan_el_dir, ent->d_name); |
| @@ -350,10 +350,10 @@ inline int build_channel_array(const char *device_dir, | |||
| 350 | ret = -errno; | 350 | ret = -errno; |
| 351 | goto error_cleanup_array; | 351 | goto error_cleanup_array; |
| 352 | } | 352 | } |
| 353 | fscanf(sysfsfp, "%u", ¤t->enabled); | 353 | fscanf(sysfsfp, "%u", ¤t_enabled); |
| 354 | fclose(sysfsfp); | 354 | fclose(sysfsfp); |
| 355 | 355 | ||
| 356 | if (!current->enabled) { | 356 | if (!current_enabled) { |
| 357 | free(filename); | 357 | free(filename); |
| 358 | count--; | 358 | count--; |
| 359 | continue; | 359 | continue; |
diff --git a/drivers/staging/iio/adc/ad799x_core.c b/drivers/staging/iio/adc/ad799x_core.c index 5ea36410f716..31a2be688060 100644 --- a/drivers/staging/iio/adc/ad799x_core.c +++ b/drivers/staging/iio/adc/ad799x_core.c | |||
| @@ -409,7 +409,13 @@ static const struct iio_event_spec ad799x_events[] = { | |||
| 409 | .info_mask_separate = BIT(IIO_CHAN_INFO_RAW), \ | 409 | .info_mask_separate = BIT(IIO_CHAN_INFO_RAW), \ |
| 410 | .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE), \ | 410 | .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE), \ |
| 411 | .scan_index = (_index), \ | 411 | .scan_index = (_index), \ |
| 412 | .scan_type = IIO_ST('u', _realbits, 16, 12 - (_realbits)), \ | 412 | .scan_type = { \ |
| 413 | .sign = 'u', \ | ||
| 414 | .realbits = (_realbits), \ | ||
| 415 | .storagebits = 16, \ | ||
| 416 | .shift = 12 - (_realbits), \ | ||
| 417 | .endianness = IIO_BE, \ | ||
| 418 | }, \ | ||
| 413 | .event_spec = _ev_spec, \ | 419 | .event_spec = _ev_spec, \ |
| 414 | .num_event_specs = _num_ev_spec, \ | 420 | .num_event_specs = _num_ev_spec, \ |
| 415 | } | 421 | } |
| @@ -588,7 +594,8 @@ static int ad799x_probe(struct i2c_client *client, | |||
| 588 | return 0; | 594 | return 0; |
| 589 | 595 | ||
| 590 | error_free_irq: | 596 | error_free_irq: |
| 591 | free_irq(client->irq, indio_dev); | 597 | if (client->irq > 0) |
| 598 | free_irq(client->irq, indio_dev); | ||
| 592 | error_cleanup_ring: | 599 | error_cleanup_ring: |
| 593 | ad799x_ring_cleanup(indio_dev); | 600 | ad799x_ring_cleanup(indio_dev); |
| 594 | error_disable_reg: | 601 | error_disable_reg: |
diff --git a/drivers/staging/iio/impedance-analyzer/ad5933.c b/drivers/staging/iio/impedance-analyzer/ad5933.c index 0a4298b744e6..2b96665da8a2 100644 --- a/drivers/staging/iio/impedance-analyzer/ad5933.c +++ b/drivers/staging/iio/impedance-analyzer/ad5933.c | |||
| @@ -629,7 +629,7 @@ static int ad5933_register_ring_funcs_and_init(struct iio_dev *indio_dev) | |||
| 629 | struct iio_buffer *buffer; | 629 | struct iio_buffer *buffer; |
| 630 | 630 | ||
| 631 | buffer = iio_kfifo_allocate(indio_dev); | 631 | buffer = iio_kfifo_allocate(indio_dev); |
| 632 | if (buffer) | 632 | if (!buffer) |
| 633 | return -ENOMEM; | 633 | return -ENOMEM; |
| 634 | 634 | ||
| 635 | iio_device_attach_buffer(indio_dev, buffer); | 635 | iio_device_attach_buffer(indio_dev, buffer); |
