Skip to content

Commit

Permalink
Merge tag 'iio-fixes-3.6b' of git://git.kernel.org/pub/scm/linux/kern…
Browse files Browse the repository at this point in the history
…el/git/jic23/iio into staging-next

IIO fixes for elements queued for 3.6 merge window.

3 types of fix here.

1) Incorrect pointer casting via phys_addr_t which causes
   trouble on some architectures.
2) request_irq and free_irq dev_id parameters not matching.
3) Inconsistencies in client_data for some i2c devices
(writing one pointer and expecting another later).
  • Loading branch information
Greg Kroah-Hartman committed Jul 17, 2012
2 parents f555f12 + dcbc3c4 commit 8405f04
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 10 deletions.
2 changes: 1 addition & 1 deletion drivers/iio/light/adjd_s311.c
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ static irqreturn_t adjd_s311_trigger_handler(int irq, void *p)
}

if (indio_dev->scan_timestamp)
*(s64 *)((phys_addr_t)data->buffer + ALIGN(len, sizeof(s64)))
*(s64 *)((u8 *)data->buffer + ALIGN(len, sizeof(s64)))
= time_ns;
iio_push_to_buffer(buffer, (u8 *)data->buffer, time_ns);

Expand Down
3 changes: 1 addition & 2 deletions drivers/staging/iio/accel/lis3l02dq_ring.c
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,7 @@ static irqreturn_t lis3l02dq_trigger_handler(int irq, void *p)

/* Guaranteed to be aligned with 8 byte boundary */
if (indio_dev->scan_timestamp)
*(s64 *)(((phys_addr_t)data + len
+ sizeof(s64) - 1) & ~(sizeof(s64) - 1))
*(s64 *)((u8 *)data + ALIGN(len, sizeof(s64)))
= pf->timestamp;
buffer->access->store_to(buffer, (u8 *)data, pf->timestamp);

Expand Down
4 changes: 2 additions & 2 deletions drivers/staging/iio/adc/lpc32xx_adc.c
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ static int __devinit lpc32xx_adc_probe(struct platform_device *pdev)
return 0;

errout5:
free_irq(irq, iodev);
free_irq(irq, info);
errout4:
clk_put(info->clk);
errout3:
Expand All @@ -214,7 +214,7 @@ static int __devexit lpc32xx_adc_remove(struct platform_device *pdev)
int irq = platform_get_irq(pdev, 0);

iio_device_unregister(iodev);
free_irq(irq, iodev);
free_irq(irq, info);
platform_set_drvdata(pdev, NULL);
clk_put(info->clk);
iounmap(info->adc_base);
Expand Down
2 changes: 1 addition & 1 deletion drivers/staging/iio/gyro/adis16260_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -617,7 +617,7 @@ static int __devinit adis16260_probe(struct spi_device *spi)
if (pd)
st->negate = pd->negate;
/* this is only used for removal purposes */
spi_set_drvdata(spi, st);
spi_set_drvdata(spi, indio_dev);

st->us = spi;
mutex_init(&st->buf_lock);
Expand Down
2 changes: 1 addition & 1 deletion drivers/staging/iio/iio_simple_dummy_buffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ static irqreturn_t iio_simple_dummy_trigger_h(int irq, void *p)
}
/* Store the timestamp at an 8 byte aligned offset */
if (indio_dev->scan_timestamp)
*(s64 *)((phys_addr_t)data + ALIGN(len, sizeof(s64)))
*(s64 *)((u8 *)data + ALIGN(len, sizeof(s64)))
= iio_get_time_ns();
buffer->access->store_to(buffer, (u8 *)data, pf->timestamp);

Expand Down
5 changes: 2 additions & 3 deletions drivers/staging/iio/light/tsl2x7x_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -2028,14 +2028,13 @@ static int tsl2x7x_resume(struct device *dev)

static int __devexit tsl2x7x_remove(struct i2c_client *client)
{
struct tsl2X7X_chip *chip = i2c_get_clientdata(client);
struct iio_dev *indio_dev = iio_priv_to_dev(chip);
struct iio_dev *indio_dev = i2c_get_clientdata(client);

tsl2x7x_chip_off(indio_dev);

iio_device_unregister(indio_dev);
if (client->irq)
free_irq(client->irq, chip->client->name);
free_irq(client->irq, indio_dev);

iio_device_free(indio_dev);

Expand Down

0 comments on commit 8405f04

Please sign in to comment.