diff options
author | Linus Walleij <linus.walleij@linaro.org> | 2021-05-19 01:07:20 +0200 |
---|---|---|
committer | Jonathan Cameron <Jonathan.Cameron@huawei.com> | 2021-06-03 18:24:13 +0100 |
commit | 8d78d1e171fc9fa49900badff0bdf8dd164ce9ae (patch) | |
tree | af3c47467fd843639c3fc6e4f3945b9a61cae849 /drivers/iio/accel | |
parent | 3d8ad94bb175c2de7200569bb706d67c45903838 (diff) |
iio: accel: st_sensors: Stop copying channels
The channels were copied only so that the .ext_info member should become
assignable. We now have compile-time static assignment so drop this code.
Cc: Hans de Goede <hdegoede@redhat.com>
Cc: Denis Ciocca <denis.ciocca@st.com>
Cc: Daniel Drake <drake@endlessm.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20210518230722.522446-3-linus.walleij@linaro.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Diffstat (limited to 'drivers/iio/accel')
-rw-r--r-- | drivers/iio/accel/st_accel_core.c | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/drivers/iio/accel/st_accel_core.c b/drivers/iio/accel/st_accel_core.c index 9abcebf767b1..28fceac9f2f6 100644 --- a/drivers/iio/accel/st_accel_core.c +++ b/drivers/iio/accel/st_accel_core.c @@ -1339,8 +1339,6 @@ int st_accel_common_probe(struct iio_dev *indio_dev) { struct st_sensor_data *adata = iio_priv(indio_dev); struct st_sensors_platform_data *pdata = dev_get_platdata(adata->dev); - struct iio_chan_spec *channels; - size_t channels_size; int err; indio_dev->modes = INDIO_DIRECT_MODE; @@ -1351,15 +1349,9 @@ int st_accel_common_probe(struct iio_dev *indio_dev) return err; adata->num_data_channels = ST_ACCEL_NUMBER_DATA_CHANNELS; + indio_dev->channels = adata->sensor_settings->ch; indio_dev->num_channels = ST_SENSORS_NUMBER_ALL_CHANNELS; - channels_size = indio_dev->num_channels * sizeof(struct iio_chan_spec); - channels = devm_kmemdup(&indio_dev->dev, - adata->sensor_settings->ch, - channels_size, GFP_KERNEL); - if (!channels) - return -ENOMEM; - /* * First try specific ACPI methods to retrieve orientation then try the * generic function. @@ -1371,7 +1363,6 @@ int st_accel_common_probe(struct iio_dev *indio_dev) return err; } - indio_dev->channels = channels; adata->current_fullscale = &adata->sensor_settings->fs.fs_avl[0]; adata->odr = adata->sensor_settings->odr.odr_avl[0].hz; |