summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhilipp Zabel <p.zabel@pengutronix.de>2017-05-30 16:09:43 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2017-06-01 08:31:49 +0200
commit46188f4174ff4f1e0f6da76cfcf06521b6350794 (patch)
tree2f796cde12c62bfa2ba32a99a5579b38b7f7c43f
parent07956317863ef357e135d44e433dc5bb71bb2a90 (diff)
downloadbarebox-46188f4174ff4f1e0f6da76cfcf06521b6350794.tar.gz
cdev: make file operations const
scripts/checkpatch.pl warns that struct file_operations should be const, but cdev->ops is not const, so without this patch we can choose between a warning from checkpatch and a warning from the compiler about discarding the const attribute when assigning the struct file_operations cdev->ops. Since there is no reason to modify the contents of cdev->ops after probing, make it const. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r--include/driver.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/driver.h b/include/driver.h
index b743ed8..1edc157 100644
--- a/include/driver.h
+++ b/include/driver.h
@@ -440,7 +440,7 @@ struct file_operations {
#define MAX_PARTUUID_STR sizeof("00112233-4455-6677-8899-AABBCCDDEEFF")
struct cdev {
- struct file_operations *ops;
+ const struct file_operations *ops;
void *priv;
struct device_d *dev;
struct device_node *device_node;