aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJulia Lawall <Julia.Lawall@lip6.fr>2015-10-11 07:24:13 -0400
committerSamuel Ortiz <sameo@linux.intel.com>2015-10-19 14:04:13 -0400
commit7cf6d08cafd67a34d0d78cd15baf64e214e050cb (patch)
tree72c50f7f6a543bca90cbda52d526f990bccbcdec
parent893a84e8180dcc37a3b0fd19d04dbe6cbc6e33db (diff)
NFC: nxp-nci: constify nxp_nci_phy_ops structure
The only instance of a nxp_nci_phy_ops structure is never modified. Thus the declaration of the structure and all references to the structure type can be made const. Done with the help of Coccinelle. Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
-rw-r--r--drivers/nfc/nxp-nci/core.c3
-rw-r--r--drivers/nfc/nxp-nci/i2c.c2
-rw-r--r--drivers/nfc/nxp-nci/nxp-nci.h5
3 files changed, 6 insertions, 4 deletions
diff --git a/drivers/nfc/nxp-nci/core.c b/drivers/nfc/nxp-nci/core.c
index 8979636d48ea..2e4b004a96aa 100644
--- a/drivers/nfc/nxp-nci/core.c
+++ b/drivers/nfc/nxp-nci/core.c
@@ -109,7 +109,8 @@ static struct nci_ops nxp_nci_ops = {
109}; 109};
110 110
111int nxp_nci_probe(void *phy_id, struct device *pdev, 111int nxp_nci_probe(void *phy_id, struct device *pdev,
112 struct nxp_nci_phy_ops *phy_ops, unsigned int max_payload, 112 const struct nxp_nci_phy_ops *phy_ops,
113 unsigned int max_payload,
113 struct nci_dev **ndev) 114 struct nci_dev **ndev)
114{ 115{
115 struct nxp_nci_info *info; 116 struct nxp_nci_info *info;
diff --git a/drivers/nfc/nxp-nci/i2c.c b/drivers/nfc/nxp-nci/i2c.c
index fac80c691914..df4333c7ee0f 100644
--- a/drivers/nfc/nxp-nci/i2c.c
+++ b/drivers/nfc/nxp-nci/i2c.c
@@ -106,7 +106,7 @@ static int nxp_nci_i2c_write(void *phy_id, struct sk_buff *skb)
106 return r; 106 return r;
107} 107}
108 108
109static struct nxp_nci_phy_ops i2c_phy_ops = { 109static const struct nxp_nci_phy_ops i2c_phy_ops = {
110 .set_mode = nxp_nci_i2c_set_mode, 110 .set_mode = nxp_nci_i2c_set_mode,
111 .write = nxp_nci_i2c_write, 111 .write = nxp_nci_i2c_write,
112}; 112};
diff --git a/drivers/nfc/nxp-nci/nxp-nci.h b/drivers/nfc/nxp-nci/nxp-nci.h
index f1fecc4e2457..20408cbff4f1 100644
--- a/drivers/nfc/nxp-nci/nxp-nci.h
+++ b/drivers/nfc/nxp-nci/nxp-nci.h
@@ -68,7 +68,7 @@ struct nxp_nci_info {
68 68
69 enum nxp_nci_mode mode; 69 enum nxp_nci_mode mode;
70 70
71 struct nxp_nci_phy_ops *phy_ops; 71 const struct nxp_nci_phy_ops *phy_ops;
72 unsigned int max_payload; 72 unsigned int max_payload;
73 73
74 struct mutex info_lock; 74 struct mutex info_lock;
@@ -82,7 +82,8 @@ void nxp_nci_fw_recv_frame(struct nci_dev *ndev, struct sk_buff *skb);
82void nxp_nci_fw_work_complete(struct nxp_nci_info *info, int result); 82void nxp_nci_fw_work_complete(struct nxp_nci_info *info, int result);
83 83
84int nxp_nci_probe(void *phy_id, struct device *pdev, 84int nxp_nci_probe(void *phy_id, struct device *pdev,
85 struct nxp_nci_phy_ops *phy_ops, unsigned int max_payload, 85 const struct nxp_nci_phy_ops *phy_ops,
86 unsigned int max_payload,
86 struct nci_dev **ndev); 87 struct nci_dev **ndev);
87void nxp_nci_remove(struct nci_dev *ndev); 88void nxp_nci_remove(struct nci_dev *ndev);
88 89