Skip to content

Commit efabcb3

Browse files
dlechjic23
authored andcommitted
iio: light: zopt2201: make zopt2201_scale const
Add const qualifier to struct zopt2201_scale zopt2201_scale_*[]. 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-22-v1-1-fc9ebdc5f5c3@baylibre.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
1 parent 75abee3 commit efabcb3

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

drivers/iio/light/zopt2201.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ struct zopt2201_scale {
119119
u8 res; /* resolution register value */
120120
};
121121

122-
static struct zopt2201_scale zopt2201_scale_als[] = {
122+
static const struct zopt2201_scale zopt2201_scale_als[] = {
123123
{ 19, 200000, 0, 5 },
124124
{ 6, 400000, 1, 5 },
125125
{ 3, 200000, 2, 5 },
@@ -144,7 +144,7 @@ static struct zopt2201_scale zopt2201_scale_als[] = {
144144
{ 0, 8333, 4, 0 },
145145
};
146146

147-
static struct zopt2201_scale zopt2201_scale_uvb[] = {
147+
static const struct zopt2201_scale zopt2201_scale_uvb[] = {
148148
{ 0, 460800, 0, 5 },
149149
{ 0, 153600, 1, 5 },
150150
{ 0, 76800, 2, 5 },
@@ -347,7 +347,7 @@ static int zopt2201_set_gain(struct zopt2201_data *data, u8 gain)
347347
}
348348

349349
static int zopt2201_write_scale_by_idx(struct zopt2201_data *data, int idx,
350-
struct zopt2201_scale *zopt2201_scale_array)
350+
const struct zopt2201_scale *zopt2201_scale_array)
351351
{
352352
int ret;
353353

0 commit comments

Comments
 (0)