Skip to content

Commit cc4c60c

Browse files
committed
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.
2 parents 1ec2183 + d4c65fe commit cc4c60c

File tree

6 files changed

+10
-7
lines changed

6 files changed

+10
-7
lines changed

drivers/iio/adc/qcom-spmi-vadc.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -839,8 +839,10 @@ static int vadc_get_dt_data(struct vadc_priv *vadc, struct device_node *node)
839839

840840
for_each_available_child_of_node(node, child) {
841841
ret = vadc_get_dt_channel_data(vadc->dev, &prop, child);
842-
if (ret)
842+
if (ret) {
843+
of_node_put(child);
843844
return ret;
845+
}
844846

845847
vadc->chan_props[index] = prop;
846848

drivers/iio/industrialio-buffer.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ static int iio_scan_mask_set(struct iio_dev *indio_dev,
302302
if (trialmask == NULL)
303303
return -ENOMEM;
304304
if (!indio_dev->masklength) {
305-
WARN_ON("Trying to set scanmask prior to registering buffer\n");
305+
WARN(1, "Trying to set scanmask prior to registering buffer\n");
306306
goto err_invalid_mask;
307307
}
308308
bitmap_copy(trialmask, buffer->scan_mask, indio_dev->masklength);

drivers/iio/industrialio-core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -655,7 +655,7 @@ int __iio_device_attr_init(struct device_attribute *dev_attr,
655655
break;
656656
case IIO_SEPARATE:
657657
if (!chan->indexed) {
658-
WARN_ON("Differential channels must be indexed\n");
658+
WARN(1, "Differential channels must be indexed\n");
659659
ret = -EINVAL;
660660
goto error_free_full_postfix;
661661
}

drivers/iio/light/apds9960.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -453,6 +453,7 @@ static int apds9960_set_power_state(struct apds9960_data *data, bool on)
453453
usleep_range(data->als_adc_int_us,
454454
APDS9960_MAX_INT_TIME_IN_US);
455455
} else {
456+
pm_runtime_mark_last_busy(dev);
456457
ret = pm_runtime_put_autosuspend(dev);
457458
}
458459

drivers/iio/proximity/pulsedlight-lidar-lite-v2.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,10 +130,10 @@ static int lidar_get_measurement(struct lidar_data *data, u16 *reg)
130130
if (ret < 0)
131131
break;
132132

133-
/* return 0 since laser is likely pointed out of range */
133+
/* return -EINVAL since laser is likely pointed out of range */
134134
if (ret & LIDAR_REG_STATUS_INVALID) {
135135
*reg = 0;
136-
ret = 0;
136+
ret = -EINVAL;
137137
break;
138138
}
139139

@@ -197,7 +197,7 @@ static irqreturn_t lidar_trigger_handler(int irq, void *private)
197197
if (!ret) {
198198
iio_push_to_buffers_with_timestamp(indio_dev, data->buffer,
199199
iio_get_time_ns());
200-
} else {
200+
} else if (ret != -EINVAL) {
201201
dev_err(&data->client->dev, "cannot read LIDAR measurement");
202202
}
203203

drivers/staging/iio/iio_simple_dummy_events.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ static irqreturn_t iio_simple_dummy_get_timestamp(int irq, void *private)
159159
struct iio_dummy_state *st = iio_priv(indio_dev);
160160

161161
st->event_timestamp = iio_get_time_ns();
162-
return IRQ_HANDLED;
162+
return IRQ_WAKE_THREAD;
163163
}
164164

165165
/**

0 commit comments

Comments
 (0)