Merge remote-tracking branch 'regulator/topic/core' into regulator-next
[cascardo/linux.git] / drivers / iio / common / st_sensors / st_sensors_buffer.c
index 1665c8e..e18bc67 100644 (file)
@@ -71,7 +71,7 @@ int st_sensors_get_buffer_element(struct iio_dev *indio_dev, u8 *buf)
                                goto st_sensors_free_memory;
                        }
 
-                       for (i = 0; i < n * num_data_channels; i++) {
+                       for (i = 0; i < n * byte_for_channel; i++) {
                                if (i < n)
                                        buf[i] = rx_array[i];
                                else