[PATCH 3/7] iio: gyro: HID: Replace method gyro_3d_adjust_channel_bit_mask()
Natália Salvino André
natalia.andre em ime.usp.br
Qui Abr 16 23:26:50 -03 2026
Replace method gyro_3d_adjust_channel_bit_mask()
with helper method hid_sensor_adjust_channel_bit_mask().
Signed-off-by: Natália Salvino André <natalia.andre em ime.usp.br>
Co-developed-by: Pietro Di Consolo Gregorio <pietro.gregorio em usp.br>
Signed-off-by: Pietro Di Consolo Gregorio <pietro.gregorio em usp.br>
---
drivers/iio/gyro/hid-sensor-gyro-3d.c | 13 +------------
1 file changed, 1 insertion(+), 12 deletions(-)
diff --git a/drivers/iio/gyro/hid-sensor-gyro-3d.c b/drivers/iio/gyro/hid-sensor-gyro-3d.c
index c340cc899a7c..15704e05ad32 100644
--- a/drivers/iio/gyro/hid-sensor-gyro-3d.c
+++ b/drivers/iio/gyro/hid-sensor-gyro-3d.c
@@ -82,17 +82,6 @@ static const struct iio_chan_spec gyro_3d_channels[] = {
IIO_CHAN_SOFT_TIMESTAMP(CHANNEL_SCAN_INDEX_TIMESTAMP)
};
-/* Adjust channel real bits based on report descriptor */
-static void gyro_3d_adjust_channel_bit_mask(struct iio_chan_spec *channels,
- int channel, int size)
-{
- channels[channel].scan_type.sign = 's';
- /* Real storage bits will change based on the report desc. */
- channels[channel].scan_type.realbits = size * 8;
- /* Maximum size of a sample to capture is u32 */
- channels[channel].scan_type.storagebits = sizeof(u32) * 8;
-}
-
/* Channel read_raw handler */
static int gyro_3d_read_raw(struct iio_dev *indio_dev,
struct iio_chan_spec const *chan,
@@ -258,7 +247,7 @@ static int gyro_3d_parse_report(struct platform_device *pdev,
&st->gyro[CHANNEL_SCAN_INDEX_X + i]);
if (ret < 0)
break;
- gyro_3d_adjust_channel_bit_mask(channels,
+ hid_sensor_adjust_channel_bit_mask(channels,
CHANNEL_SCAN_INDEX_X + i,
st->gyro[CHANNEL_SCAN_INDEX_X + i].size);
}
--
2.51.0
Mais detalhes sobre a lista de discussão kernel