diff options
author | Lars-Peter Clausen <lars@metafoo.de> | 2021-10-31 09:04:21 +0100 |
---|---|---|
committer | Jonathan Cameron <Jonathan.Cameron@huawei.com> | 2021-11-17 18:51:35 +0100 |
commit | 3c33b7b8267f0795d74f407e97f3eeec2acb0165 (patch) | |
tree | 095e7043f8925e041b7b205180be92446956d047 /drivers/iio/industrialio-core.c | |
parent | iio/scmi: Add reading "raw" attribute. (diff) | |
download | linux-3c33b7b8267f0795d74f407e97f3eeec2acb0165.tar.xz linux-3c33b7b8267f0795d74f407e97f3eeec2acb0165.zip |
iio: Mark iio_device_type as const
The iio_device_type struct is never modified, mark it as const. This allows
it to be placed in a read-only memory section, which will protect against
accidental or deliberate modification.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Link: https://lore.kernel.org/r/20211031080421.2086-1-lars@metafoo.de
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Diffstat (limited to 'drivers/iio/industrialio-core.c')
-rw-r--r-- | drivers/iio/industrialio-core.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/iio/industrialio-core.c b/drivers/iio/industrialio-core.c index d94d26b11473..20d5178ca073 100644 --- a/drivers/iio/industrialio-core.c +++ b/drivers/iio/industrialio-core.c @@ -1622,7 +1622,7 @@ static void iio_dev_release(struct device *device) kfree(iio_dev_opaque); } -struct device_type iio_device_type = { +const struct device_type iio_device_type = { .name = "iio_device", .release = iio_dev_release, }; |