]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
iio: common: cros_ec_sensors_core: use new '.masklength' accessors
authorNuno Sa <nuno.sa@analog.com>
Fri, 26 Jul 2024 08:23:13 +0000 (10:23 +0200)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sat, 3 Aug 2024 09:13:43 +0000 (10:13 +0100)
Make use of iio_get_masklength) and iio_for_each_active_channel() to
access '.masklength' so it can be annotated as __private when there
are no more direct users of it.

Signed-off-by: Nuno Sa <nuno.sa@analog.com>
Link: https://patch.msgid.link/20240726-dev-iio-masklength-private3-v1-21-82913fc0fb87@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/common/cros_ec_sensors/cros_ec_sensors_core.c

index 6bfe5d6847e75469ccc69a2940548e9c90b77b17..9fc71a73caa12568d2e2c38eef28a7a6144e5062 100644 (file)
@@ -198,9 +198,7 @@ int cros_ec_sensors_push_data(struct iio_dev *indio_dev,
                return 0;
 
        out = (s16 *)st->samples;
-       for_each_set_bit(i,
-                        indio_dev->active_scan_mask,
-                        indio_dev->masklength) {
+       iio_for_each_active_channel(indio_dev, i) {
                *out = data[i];
                out++;
        }
@@ -587,7 +585,7 @@ static int cros_ec_sensors_read_data_unsafe(struct iio_dev *indio_dev,
        int ret;
 
        /* Read all sensors enabled in scan_mask. Each value is 2 bytes. */
-       for_each_set_bit(i, &scan_mask, indio_dev->masklength) {
+       for_each_set_bit(i, &scan_mask, iio_get_masklength(indio_dev)) {
                ret = cros_ec_sensors_cmd_read_u16(ec,
                                             cros_ec_sensors_idx_to_reg(st, i),
                                             data);
@@ -683,7 +681,7 @@ int cros_ec_sensors_read_cmd(struct iio_dev *indio_dev,
                return ret;
        }
 
-       for_each_set_bit(i, &scan_mask, indio_dev->masklength) {
+       for_each_set_bit(i, &scan_mask, iio_get_masklength(indio_dev)) {
                *data = st->resp->data.data[i];
                data++;
        }