Merge tag 'phy-for-5.18' of git://git.kernel.org/pub/scm/linux/kernel/git/phy/linux...
[linux-2.6-microblaze.git] / drivers / iio / adc / ti-tsc2046.c
index d84ae6b..e8fc4d0 100644 (file)
@@ -388,7 +388,7 @@ static int tsc2046_adc_update_scan_mode(struct iio_dev *indio_dev,
        mutex_lock(&priv->slock);
 
        size = 0;
-       for_each_set_bit(ch_idx, active_scan_mask, indio_dev->num_channels) {
+       for_each_set_bit(ch_idx, active_scan_mask, ARRAY_SIZE(priv->l)) {
                size += tsc2046_adc_group_set_layout(priv, group, ch_idx);
                tsc2046_adc_group_set_cmd(priv, group, ch_idx);
                group++;
@@ -548,7 +548,7 @@ static int tsc2046_adc_setup_spi_msg(struct tsc2046_adc_priv *priv)
         * enabled.
         */
        size = 0;
-       for (ch_idx = 0; ch_idx < priv->dcfg->num_channels; ch_idx++)
+       for (ch_idx = 0; ch_idx < ARRAY_SIZE(priv->l); ch_idx++)
                size += tsc2046_adc_group_set_layout(priv, ch_idx, ch_idx);
 
        priv->tx = devm_kzalloc(&priv->spi->dev, size, GFP_KERNEL);