Commit 3c33b7b8 authored by Lars-Peter Clausen's avatar Lars-Peter Clausen Committed by Jonathan Cameron

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: default avatarLars-Peter Clausen <lars@metafoo.de>
Link: https://lore.kernel.org/r/20211031080421.2086-1-lars@metafoo.deSigned-off-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
parent 1fd85607
...@@ -16,7 +16,7 @@ struct iio_buffer; ...@@ -16,7 +16,7 @@ struct iio_buffer;
struct iio_chan_spec; struct iio_chan_spec;
struct iio_dev; struct iio_dev;
extern struct device_type iio_device_type; extern const struct device_type iio_device_type;
struct iio_dev_buffer_pair { struct iio_dev_buffer_pair {
struct iio_dev *indio_dev; struct iio_dev *indio_dev;
......
...@@ -1622,7 +1622,7 @@ static void iio_dev_release(struct device *device) ...@@ -1622,7 +1622,7 @@ static void iio_dev_release(struct device *device)
kfree(iio_dev_opaque); kfree(iio_dev_opaque);
} }
struct device_type iio_device_type = { const struct device_type iio_device_type = {
.name = "iio_device", .name = "iio_device",
.release = iio_dev_release, .release = iio_dev_release,
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment