Second set of IIO fixes for the 4.4 cycle.
Some of these were waiting for various code to hit during the merge window - others have simply shown up recently. * Dummy - fix a bug introduced recently that stops events actually reaching userspace. * Lidar - return -EINVAL on getting a report of an invalid reading from the device. This could mean that nothing is in range, or something else has gone wrong. Basically it tells us nothing useful beyond the reading is bogus and should be ignored. * apds9660 - make sure to call pm_runtime_mark_last_busy when reading from the device to avoid a premature disabling of the power. * core - fix up a few missues of the WARN macro. * spmi-vadc - fix a missing of_node_put when breaking out of a for_each_available_child_of_node loop. The dummy driver is going to result in a slightly interesting merge when this meets the togreg branch as that driver has graduated from staging in the meantime. I'll send an email in reply to that pull request highlighting this as well. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAABCAAGBQJWUc8MAAoJEFSFNJnE9BaIlCoQAI873uKlChbGt8uperACvvfn Q6UAcFIenEJrudve/C4zfjnYIKzxG6v6A1fUhoiOmJ0k/2wHYd6Lb27jT15Nsnkm 2hS4KAzc4mngxCc0upK0qCOWTVCHmRuvm1i2cHaMAugcExpyoXRmLkWRvwwrEb4h NS5Qr9wQOGnBU7mOlZyqP6PQq2tU18eNLCg6A+cVMoq3z9CN0MH/x6pTV6O29PIx 88jwaNnPL7EoBxSTziYIbyXLEy7/x4RlIxxkSU75jHc5JHChoH4f+BXKzxjdVqh+ nL2Ok8BSnJV1cngqZDPZXcBrbeAKvhXyi7vExE6ntzMh0pTd+8wwyggddETJ/zIw JsiN1qg4jSre97UCnW/F+owSxVkg+ptgT4zZGNikffA5W+HsE6CxHMiGiuzAkBf3 AdUdIv778/KKkblQGmlHADLwLWo0r09yqilkNEzqH5zY+v+02aEWzJSnJl6Qh55v 7DEgcuzhYzKuIzuq1RYjT+HhAIPFFTRTYIPLjT0zBcwHtYhfpVpq3UzNJ4p3ehNd Pumg+OY7jWabPDar7ZthYYxGLzD5u4jeFdXiua7kUat84O8n0YomoPkobHEP1IcI AvBZisjeREorVfwMtphyL0mL1bAZxo+/KS4NlbbZv+LKNeP1fk/T4wbgtI/tYJNF mdr3uk6y4FVFHm4WrNCe =MrHH -----END PGP SIGNATURE----- Merge tag 'iio-fixes-for-4.4b' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-linus Jonathan writes: Second set of IIO fixes for the 4.4 cycle. Some of these were waiting for various code to hit during the merge window - others have simply shown up recently. * Dummy - fix a bug introduced recently that stops events actually reaching userspace. * Lidar - return -EINVAL on getting a report of an invalid reading from the device. This could mean that nothing is in range, or something else has gone wrong. Basically it tells us nothing useful beyond the reading is bogus and should be ignored. * apds9660 - make sure to call pm_runtime_mark_last_busy when reading from the device to avoid a premature disabling of the power. * core - fix up a few missues of the WARN macro. * spmi-vadc - fix a missing of_node_put when breaking out of a for_each_available_child_of_node loop. The dummy driver is going to result in a slightly interesting merge when this meets the togreg branch as that driver has graduated from staging in the meantime. I'll send an email in reply to that pull request highlighting this as well.
This commit is contained in:
commit
cc4c60cc25
@ -839,8 +839,10 @@ static int vadc_get_dt_data(struct vadc_priv *vadc, struct device_node *node)
|
||||
|
||||
for_each_available_child_of_node(node, child) {
|
||||
ret = vadc_get_dt_channel_data(vadc->dev, &prop, child);
|
||||
if (ret)
|
||||
if (ret) {
|
||||
of_node_put(child);
|
||||
return ret;
|
||||
}
|
||||
|
||||
vadc->chan_props[index] = prop;
|
||||
|
||||
|
@ -302,7 +302,7 @@ static int iio_scan_mask_set(struct iio_dev *indio_dev,
|
||||
if (trialmask == NULL)
|
||||
return -ENOMEM;
|
||||
if (!indio_dev->masklength) {
|
||||
WARN_ON("Trying to set scanmask prior to registering buffer\n");
|
||||
WARN(1, "Trying to set scanmask prior to registering buffer\n");
|
||||
goto err_invalid_mask;
|
||||
}
|
||||
bitmap_copy(trialmask, buffer->scan_mask, indio_dev->masklength);
|
||||
|
@ -655,7 +655,7 @@ int __iio_device_attr_init(struct device_attribute *dev_attr,
|
||||
break;
|
||||
case IIO_SEPARATE:
|
||||
if (!chan->indexed) {
|
||||
WARN_ON("Differential channels must be indexed\n");
|
||||
WARN(1, "Differential channels must be indexed\n");
|
||||
ret = -EINVAL;
|
||||
goto error_free_full_postfix;
|
||||
}
|
||||
|
@ -453,6 +453,7 @@ static int apds9960_set_power_state(struct apds9960_data *data, bool on)
|
||||
usleep_range(data->als_adc_int_us,
|
||||
APDS9960_MAX_INT_TIME_IN_US);
|
||||
} else {
|
||||
pm_runtime_mark_last_busy(dev);
|
||||
ret = pm_runtime_put_autosuspend(dev);
|
||||
}
|
||||
|
||||
|
@ -130,10 +130,10 @@ static int lidar_get_measurement(struct lidar_data *data, u16 *reg)
|
||||
if (ret < 0)
|
||||
break;
|
||||
|
||||
/* return 0 since laser is likely pointed out of range */
|
||||
/* return -EINVAL since laser is likely pointed out of range */
|
||||
if (ret & LIDAR_REG_STATUS_INVALID) {
|
||||
*reg = 0;
|
||||
ret = 0;
|
||||
ret = -EINVAL;
|
||||
break;
|
||||
}
|
||||
|
||||
@ -197,7 +197,7 @@ static irqreturn_t lidar_trigger_handler(int irq, void *private)
|
||||
if (!ret) {
|
||||
iio_push_to_buffers_with_timestamp(indio_dev, data->buffer,
|
||||
iio_get_time_ns());
|
||||
} else {
|
||||
} else if (ret != -EINVAL) {
|
||||
dev_err(&data->client->dev, "cannot read LIDAR measurement");
|
||||
}
|
||||
|
||||
|
@ -159,7 +159,7 @@ static irqreturn_t iio_simple_dummy_get_timestamp(int irq, void *private)
|
||||
struct iio_dummy_state *st = iio_priv(indio_dev);
|
||||
|
||||
st->event_timestamp = iio_get_time_ns();
|
||||
return IRQ_HANDLED;
|
||||
return IRQ_WAKE_THREAD;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user