Skip to content

Commit

Permalink
Merge tag 'iio-fixes-for-3.8a' 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 says:

	First round of fixes for IIO post 3.8-rc1.

	A set of worthy if rather dull little fixes.

	* A whole set of incorrect error handling on regulator voltage requests.
	* An error in the probe path for max1363.
	* A couple of Kconfig issues with missing/ignored dependencies.
	* A nasty shift vs compare typo in adf4350
	* Bug fixes for a silly error that prevents at91_adc driver building.
  • Loading branch information
gregkh committed Jan 7, 2013
2 parents da849a9 + 678fb42 commit ef1d17d
Show file tree
Hide file tree
Showing 17 changed files with 69 additions and 21 deletions.
1 change: 1 addition & 0 deletions drivers/iio/accel/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ config HID_SENSOR_ACCEL_3D
select IIO_BUFFER
select IIO_TRIGGERED_BUFFER
select HID_SENSOR_IIO_COMMON
select HID_SENSOR_IIO_TRIGGER
tristate "HID Accelerometers 3D"
help
Say yes here to build support for the HID SENSOR
Expand Down
6 changes: 5 additions & 1 deletion drivers/iio/adc/ad7266.c
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,11 @@ static int __devinit ad7266_probe(struct spi_device *spi)
if (ret)
goto error_put_reg;

st->vref_uv = regulator_get_voltage(st->reg);
ret = regulator_get_voltage(st->reg);
if (ret < 0)
goto error_disable_reg;

st->vref_uv = ret;
} else {
/* Use internal reference */
st->vref_uv = 2500000;
Expand Down
2 changes: 1 addition & 1 deletion drivers/iio/adc/at91_adc.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ static irqreturn_t at91_adc_trigger_handler(int irq, void *p)
*timestamp = pf->timestamp;
}

iio_push_to_buffers(indio_dev, (u8 *)st->buffer);
iio_push_to_buffers(idev, (u8 *)st->buffer);

iio_trigger_notify_done(idev->trig);

Expand Down
13 changes: 6 additions & 7 deletions drivers/iio/adc/max1363.c
Original file line number Diff line number Diff line change
Expand Up @@ -1605,19 +1605,20 @@ static int __devinit max1363_probe(struct i2c_client *client,

return 0;
error_free_irq:
free_irq(st->client->irq, indio_dev);
if (client->irq)
free_irq(st->client->irq, indio_dev);
error_uninit_buffer:
iio_buffer_unregister(indio_dev);
error_cleanup_buffer:
max1363_buffer_cleanup(indio_dev);
error_free_available_scan_masks:
kfree(indio_dev->available_scan_masks);
error_unregister_map:
iio_map_array_unregister(indio_dev, client->dev.platform_data);
error_disable_reg:
regulator_disable(st->reg);
error_put_reg:
regulator_put(st->reg);
error_unregister_map:
iio_map_array_unregister(indio_dev, client->dev.platform_data);
error_free_device:
iio_device_free(indio_dev);
error_out:
Expand All @@ -1635,10 +1636,8 @@ static int __devexit max1363_remove(struct i2c_client *client)
iio_buffer_unregister(indio_dev);
max1363_buffer_cleanup(indio_dev);
kfree(indio_dev->available_scan_masks);
if (!IS_ERR(st->reg)) {
regulator_disable(st->reg);
regulator_put(st->reg);
}
regulator_disable(st->reg);
regulator_put(st->reg);
iio_map_array_unregister(indio_dev, client->dev.platform_data);
iio_device_free(indio_dev);

Expand Down
13 changes: 12 additions & 1 deletion drivers/iio/common/hid-sensors/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,25 @@ menu "Hid Sensor IIO Common"
config HID_SENSOR_IIO_COMMON
tristate "Common modules for all HID Sensor IIO drivers"
depends on HID_SENSOR_HUB
select IIO_TRIGGER if IIO_BUFFER
select HID_SENSOR_IIO_TRIGGER if IIO_BUFFER
help
Say yes here to build support for HID sensor to use
HID sensor common processing for attributes and IIO triggers.
There are many attributes which can be shared among multiple
HID sensor drivers, this module contains processing for those
attributes.

config HID_SENSOR_IIO_TRIGGER
tristate "Common module (trigger) for all HID Sensor IIO drivers"
depends on HID_SENSOR_HUB && HID_SENSOR_IIO_COMMON
select IIO_TRIGGER
help
Say yes here to build trigger support for HID sensors.
Triggers will be send if all requested attributes were read.

If this driver is compiled as a module, it will be named
hid-sensor-trigger.

config HID_SENSOR_ENUM_BASE_QUIRKS
bool "ENUM base quirks for HID Sensor IIO drivers"
depends on HID_SENSOR_IIO_COMMON
Expand Down
3 changes: 2 additions & 1 deletion drivers/iio/common/hid-sensors/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@
#

obj-$(CONFIG_HID_SENSOR_IIO_COMMON) += hid-sensor-iio-common.o
hid-sensor-iio-common-y := hid-sensor-attributes.o hid-sensor-trigger.o
obj-$(CONFIG_HID_SENSOR_IIO_TRIGGER) += hid-sensor-trigger.o
hid-sensor-iio-common-y := hid-sensor-attributes.o
6 changes: 5 additions & 1 deletion drivers/iio/dac/ad5380.c
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,11 @@ static int __devinit ad5380_probe(struct device *dev, struct regmap *regmap,
goto error_free_reg;
}

st->vref = regulator_get_voltage(st->vref_reg);
ret = regulator_get_voltage(st->vref_reg);
if (ret < 0)
goto error_disable_reg;

st->vref = ret;
} else {
st->vref = st->chip_info->int_vref;
ctrl |= AD5380_CTRL_INT_VREF_EN;
Expand Down
6 changes: 5 additions & 1 deletion drivers/iio/dac/ad5446.c
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,11 @@ static int __devinit ad5446_probe(struct device *dev, const char *name,
if (ret)
goto error_put_reg;

voltage_uv = regulator_get_voltage(reg);
ret = regulator_get_voltage(reg);
if (ret < 0)
goto error_disable_reg;

voltage_uv = ret;
}

indio_dev = iio_device_alloc(sizeof(*st));
Expand Down
6 changes: 5 additions & 1 deletion drivers/iio/dac/ad5504.c
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,11 @@ static int __devinit ad5504_probe(struct spi_device *spi)
if (ret)
goto error_put_reg;

voltage_uv = regulator_get_voltage(reg);
ret = regulator_get_voltage(reg);
if (ret < 0)
goto error_disable_reg;

voltage_uv = ret;
}

spi_set_drvdata(spi, indio_dev);
Expand Down
6 changes: 5 additions & 1 deletion drivers/iio/dac/ad5624r_spi.c
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,11 @@ static int __devinit ad5624r_probe(struct spi_device *spi)
if (ret)
goto error_put_reg;

voltage_uv = regulator_get_voltage(st->reg);
ret = regulator_get_voltage(st->reg);
if (ret < 0)
goto error_disable_reg;

voltage_uv = ret;
}

spi_set_drvdata(spi, indio_dev);
Expand Down
6 changes: 5 additions & 1 deletion drivers/iio/dac/ad5686.c
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,11 @@ static int __devinit ad5686_probe(struct spi_device *spi)
if (ret)
goto error_put_reg;

voltage_uv = regulator_get_voltage(st->reg);
ret = regulator_get_voltage(st->reg);
if (ret < 0)
goto error_disable_reg;

voltage_uv = ret;
}

st->chip_info =
Expand Down
13 changes: 11 additions & 2 deletions drivers/iio/dac/ad5791.c
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,11 @@ static int __devinit ad5791_probe(struct spi_device *spi)
if (ret)
goto error_put_reg_pos;

pos_voltage_uv = regulator_get_voltage(st->reg_vdd);
ret = regulator_get_voltage(st->reg_vdd);
if (ret < 0)
goto error_disable_reg_pos;

pos_voltage_uv = ret;
}

st->reg_vss = regulator_get(&spi->dev, "vss");
Expand All @@ -374,7 +378,11 @@ static int __devinit ad5791_probe(struct spi_device *spi)
if (ret)
goto error_put_reg_neg;

neg_voltage_uv = regulator_get_voltage(st->reg_vss);
ret = regulator_get_voltage(st->reg_vss);
if (ret < 0)
goto error_disable_reg_neg;

neg_voltage_uv = ret;
}

st->pwr_down = true;
Expand Down Expand Up @@ -428,6 +436,7 @@ static int __devinit ad5791_probe(struct spi_device *spi)
if (!IS_ERR(st->reg_vss))
regulator_put(st->reg_vss);

error_disable_reg_pos:
if (!IS_ERR(st->reg_vdd))
regulator_disable(st->reg_vdd);
error_put_reg_pos:
Expand Down
2 changes: 1 addition & 1 deletion drivers/iio/frequency/adf4350.c
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ static int adf4350_set_freq(struct adf4350_state *st, unsigned long long freq)
} while ((st->r1_mod > ADF4350_MAX_MODULUS) && r_cnt);
} while (r_cnt == 0);

tmp = freq * (u64)st->r1_mod + (st->fpfd > 1);
tmp = freq * (u64)st->r1_mod + (st->fpfd >> 1);
do_div(tmp, st->fpfd); /* Div round closest (n + d/2)/d */
st->r0_fract = do_div(tmp, st->r1_mod);
st->r0_int = tmp;
Expand Down
1 change: 1 addition & 0 deletions drivers/iio/gyro/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ config HID_SENSOR_GYRO_3D
select IIO_BUFFER
select IIO_TRIGGERED_BUFFER
select HID_SENSOR_IIO_COMMON
select HID_SENSOR_IIO_TRIGGER
tristate "HID Gyroscope 3D"
help
Say yes here to build support for the HID SENSOR
Expand Down
1 change: 1 addition & 0 deletions drivers/iio/light/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ config HID_SENSOR_ALS
select IIO_BUFFER
select IIO_TRIGGERED_BUFFER
select HID_SENSOR_IIO_COMMON
select HID_SENSOR_IIO_TRIGGER
tristate "HID ALS"
help
Say yes here to build support for the HID SENSOR
Expand Down
1 change: 1 addition & 0 deletions drivers/iio/magnetometer/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ config HID_SENSOR_MAGNETOMETER_3D
select IIO_BUFFER
select IIO_TRIGGERED_BUFFER
select HID_SENSOR_IIO_COMMON
select HID_SENSOR_IIO_TRIGGER
tristate "HID Magenetometer 3D"
help
Say yes here to build support for the HID SENSOR
Expand Down
4 changes: 2 additions & 2 deletions drivers/staging/iio/gyro/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ config ADIS16130
config ADIS16260
tristate "Analog Devices ADIS16260 Digital Gyroscope Sensor SPI driver"
depends on SPI
select IIO_TRIGGER if IIO_BUFFER
select IIO_SW_RING if IIO_BUFFER
select IIO_ADIS_LIB
select IIO_ADIS_LIB_BUFFER if IIO_BUFFER
help
Say yes here to build support for Analog Devices ADIS16260 ADIS16265
ADIS16250 ADIS16255 and ADIS16251 programmable digital gyroscope sensors.
Expand Down

0 comments on commit ef1d17d

Please sign in to comment.