Skip to content

Commit 6942d81

Browse files
committed
Merge tag 'staging-5.13-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging
Pull staging and IIO driver fixes from Greg KH: "Here are some small IIO driver fixes and one Staging driver fix for 5.13-rc2. Nothing major, just some resolutions for reported problems: - gcc-11 bogus warning fix for rtl8723bs - iio driver tiny fixes All of these have been in linux-next for many days with no reported issues" * tag 'staging-5.13-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: iio: tsl2583: Fix division by a zero lux_val iio: core: return ENODEV if ioctl is unknown iio: core: fix ioctl handlers removal iio: gyro: mpu3050: Fix reported temperature value iio: hid-sensors: select IIO_TRIGGERED_BUFFER under HID_SENSOR_IIO_TRIGGER iio: proximity: pulsedlight: Fix rumtime PM imbalance on error iio: light: gp2ap002: Fix rumtime PM imbalance on error staging: rtl8723bs: avoid bogus gcc warning
2 parents 4a66842 + ba9c25d commit 6942d81

File tree

16 files changed

+50
-41
lines changed

16 files changed

+50
-41
lines changed

drivers/iio/accel/Kconfig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,6 @@ config DMARD10
229229
config HID_SENSOR_ACCEL_3D
230230
depends on HID_SENSOR_HUB
231231
select IIO_BUFFER
232-
select IIO_TRIGGERED_BUFFER
233232
select HID_SENSOR_IIO_COMMON
234233
select HID_SENSOR_IIO_TRIGGER
235234
tristate "HID Accelerometers 3D"

drivers/iio/common/hid-sensors/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ config HID_SENSOR_IIO_TRIGGER
1919
tristate "Common module (trigger) for all HID Sensor IIO drivers"
2020
depends on HID_SENSOR_HUB && HID_SENSOR_IIO_COMMON && IIO_BUFFER
2121
select IIO_TRIGGER
22+
select IIO_TRIGGERED_BUFFER
2223
help
2324
Say yes here to build trigger support for HID sensors.
2425
Triggers will be send if all requested attributes were read.

drivers/iio/gyro/Kconfig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,6 @@ config FXAS21002C_SPI
111111
config HID_SENSOR_GYRO_3D
112112
depends on HID_SENSOR_HUB
113113
select IIO_BUFFER
114-
select IIO_TRIGGERED_BUFFER
115114
select HID_SENSOR_IIO_COMMON
116115
select HID_SENSOR_IIO_TRIGGER
117116
tristate "HID Gyroscope 3D"

drivers/iio/gyro/mpu3050-core.c

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,16 @@ static int mpu3050_read_raw(struct iio_dev *indio_dev,
272272
case IIO_CHAN_INFO_OFFSET:
273273
switch (chan->type) {
274274
case IIO_TEMP:
275-
/* The temperature scaling is (x+23000)/280 Celsius */
275+
/*
276+
* The temperature scaling is (x+23000)/280 Celsius
277+
* for the "best fit straight line" temperature range
278+
* of -30C..85C. The 23000 includes room temperature
279+
* offset of +35C, 280 is the precision scale and x is
280+
* the 16-bit signed integer reported by hardware.
281+
*
282+
* Temperature value itself represents temperature of
283+
* the sensor die.
284+
*/
276285
*val = 23000;
277286
return IIO_VAL_INT;
278287
default:
@@ -329,7 +338,7 @@ static int mpu3050_read_raw(struct iio_dev *indio_dev,
329338
goto out_read_raw_unlock;
330339
}
331340

332-
*val = be16_to_cpu(raw_val);
341+
*val = (s16)be16_to_cpu(raw_val);
333342
ret = IIO_VAL_INT;
334343

335344
goto out_read_raw_unlock;

drivers/iio/humidity/Kconfig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ config HID_SENSOR_HUMIDITY
5252
tristate "HID Environmental humidity sensor"
5353
depends on HID_SENSOR_HUB
5454
select IIO_BUFFER
55-
select IIO_TRIGGERED_BUFFER
5655
select HID_SENSOR_IIO_COMMON
5756
select HID_SENSOR_IIO_TRIGGER
5857
help

drivers/iio/industrialio-core.c

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1778,15 +1778,14 @@ static long iio_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
17781778
if (!indio_dev->info)
17791779
goto out_unlock;
17801780

1781-
ret = -EINVAL;
17821781
list_for_each_entry(h, &iio_dev_opaque->ioctl_handlers, entry) {
17831782
ret = h->ioctl(indio_dev, filp, cmd, arg);
17841783
if (ret != IIO_IOCTL_UNHANDLED)
17851784
break;
17861785
}
17871786

17881787
if (ret == IIO_IOCTL_UNHANDLED)
1789-
ret = -EINVAL;
1788+
ret = -ENODEV;
17901789

17911790
out_unlock:
17921791
mutex_unlock(&indio_dev->info_exist_lock);
@@ -1926,9 +1925,6 @@ EXPORT_SYMBOL(__iio_device_register);
19261925
**/
19271926
void iio_device_unregister(struct iio_dev *indio_dev)
19281927
{
1929-
struct iio_dev_opaque *iio_dev_opaque = to_iio_dev_opaque(indio_dev);
1930-
struct iio_ioctl_handler *h, *t;
1931-
19321928
cdev_device_del(&indio_dev->chrdev, &indio_dev->dev);
19331929

19341930
mutex_lock(&indio_dev->info_exist_lock);
@@ -1939,9 +1935,6 @@ void iio_device_unregister(struct iio_dev *indio_dev)
19391935

19401936
indio_dev->info = NULL;
19411937

1942-
list_for_each_entry_safe(h, t, &iio_dev_opaque->ioctl_handlers, entry)
1943-
list_del(&h->entry);
1944-
19451938
iio_device_wakeup_eventset(indio_dev);
19461939
iio_buffer_wakeup_poll(indio_dev);
19471940

drivers/iio/light/Kconfig

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,6 @@ config ISL29125
256256
config HID_SENSOR_ALS
257257
depends on HID_SENSOR_HUB
258258
select IIO_BUFFER
259-
select IIO_TRIGGERED_BUFFER
260259
select HID_SENSOR_IIO_COMMON
261260
select HID_SENSOR_IIO_TRIGGER
262261
tristate "HID ALS"
@@ -270,7 +269,6 @@ config HID_SENSOR_ALS
270269
config HID_SENSOR_PROX
271270
depends on HID_SENSOR_HUB
272271
select IIO_BUFFER
273-
select IIO_TRIGGERED_BUFFER
274272
select HID_SENSOR_IIO_COMMON
275273
select HID_SENSOR_IIO_TRIGGER
276274
tristate "HID PROX"

drivers/iio/light/gp2ap002.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -582,7 +582,7 @@ static int gp2ap002_probe(struct i2c_client *client,
582582
"gp2ap002", indio_dev);
583583
if (ret) {
584584
dev_err(dev, "unable to request IRQ\n");
585-
goto out_disable_vio;
585+
goto out_put_pm;
586586
}
587587
gp2ap002->irq = client->irq;
588588

@@ -612,8 +612,9 @@ static int gp2ap002_probe(struct i2c_client *client,
612612

613613
return 0;
614614

615-
out_disable_pm:
615+
out_put_pm:
616616
pm_runtime_put_noidle(dev);
617+
out_disable_pm:
617618
pm_runtime_disable(dev);
618619
out_disable_vio:
619620
regulator_disable(gp2ap002->vio);

drivers/iio/light/tsl2583.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -341,6 +341,14 @@ static int tsl2583_als_calibrate(struct iio_dev *indio_dev)
341341
return lux_val;
342342
}
343343

344+
/* Avoid division by zero of lux_value later on */
345+
if (lux_val == 0) {
346+
dev_err(&chip->client->dev,
347+
"%s: lux_val of 0 will produce out of range trim_value\n",
348+
__func__);
349+
return -ENODATA;
350+
}
351+
344352
gain_trim_val = (unsigned int)(((chip->als_settings.als_cal_target)
345353
* chip->als_settings.als_gain_trim) / lux_val);
346354
if ((gain_trim_val < 250) || (gain_trim_val > 4000)) {

drivers/iio/magnetometer/Kconfig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,6 @@ config MAG3110
9595
config HID_SENSOR_MAGNETOMETER_3D
9696
depends on HID_SENSOR_HUB
9797
select IIO_BUFFER
98-
select IIO_TRIGGERED_BUFFER
9998
select HID_SENSOR_IIO_COMMON
10099
select HID_SENSOR_IIO_TRIGGER
101100
tristate "HID Magenetometer 3D"

0 commit comments

Comments
 (0)