iio: pressure: abp060mg: make abp_config const

Add const qualifier to struct abp_config abp_config[]. This is
read-only data so it can be made const.

Signed-off-by: David Lechner <dlechner@baylibre.com>
Link: https://patch.msgid.link/20250628-iio-const-data-23-v1-1-542cfadce9d0@baylibre.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
pull/1309/head
David Lechner 2025-06-28 12:58:11 -05:00 committed by Jonathan Cameron
parent 54fde97fa8
commit 5b322dc49a
1 changed files with 2 additions and 2 deletions

View File

@ -35,7 +35,7 @@ struct abp_config {
int max; int max;
}; };
static struct abp_config abp_config[] = { static const struct abp_config abp_config[] = {
/* mbar & kPa variants */ /* mbar & kPa variants */
[ABP006KG] = { .min = 0, .max = 6000 }, [ABP006KG] = { .min = 0, .max = 6000 },
[ABP010KG] = { .min = 0, .max = 10000 }, [ABP010KG] = { .min = 0, .max = 10000 },
@ -165,7 +165,7 @@ static const struct iio_info abp060mg_info = {
static void abp060mg_init_device(struct iio_dev *indio_dev, unsigned long id) static void abp060mg_init_device(struct iio_dev *indio_dev, unsigned long id)
{ {
struct abp_state *state = iio_priv(indio_dev); struct abp_state *state = iio_priv(indio_dev);
struct abp_config *cfg = &abp_config[id]; const struct abp_config *cfg = &abp_config[id];
state->scale = cfg->max - cfg->min; state->scale = cfg->max - cfg->min;
state->offset = -ABP060MG_MIN_COUNTS; state->offset = -ABP060MG_MIN_COUNTS;