]> git.karo-electronics.de Git - linux-beck.git/commitdiff
iio: Declare event_attrs field of iio_info structure as const
authorBhumika Goyal <bhumirks@gmail.com>
Sat, 1 Oct 2016 09:57:18 +0000 (15:27 +0530)
committerJonathan Cameron <jic23@kernel.org>
Sat, 1 Oct 2016 13:37:35 +0000 (14:37 +0100)
The event_attrs field of iio_info structure is only initialized once
whenever an object of iio_info is created. After that this field
is never modified again anywhere in the kernel. So, declare event_attrs
field of iio_info as a const struct attribute_group.
Checked for occurences throughout the kernel using grep and
coccinelle.

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
include/linux/iio/iio.h

index b4a0679e4a49a22584c4288ba6bf4e6aa4df4d4b..4591d8ea41bd13bbcabbac96b1b4a9cb32b33c86 100644 (file)
@@ -381,7 +381,7 @@ struct iio_dev;
  **/
 struct iio_info {
        struct module                   *driver_module;
-       struct attribute_group          *event_attrs;
+       const struct attribute_group    *event_attrs;
        const struct attribute_group    *attrs;
 
        int (*read_raw)(struct iio_dev *indio_dev,