aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2015-04-05 01:11:43 -0400
committerMarcel Holtmann <marcel@holtmann.org>2015-04-07 12:47:10 -0400
commit4ee7ef19894c0ac35cc6dc374d65658a26d7496a (patch)
tree433bc1e398bae66dba47afc0f8b98f71915b32b1
parent2d7cc19eebc182dbdda228aa26eb5bfff97ac072 (diff)
Bluetooth: hci_uart: Make struct hci_uart_proto always const
The usage of struct hci_uart_proto should always be const. Change the function headers and individual protocol drivers. Signed-off-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
-rw-r--r--drivers/bluetooth/hci_ath.c2
-rw-r--r--drivers/bluetooth/hci_bcsp.c2
-rw-r--r--drivers/bluetooth/hci_h4.c2
-rw-r--r--drivers/bluetooth/hci_h5.c2
-rw-r--r--drivers/bluetooth/hci_ldisc.c10
-rw-r--r--drivers/bluetooth/hci_ll.c2
-rw-r--r--drivers/bluetooth/hci_uart.h6
7 files changed, 13 insertions, 13 deletions
diff --git a/drivers/bluetooth/hci_ath.c b/drivers/bluetooth/hci_ath.c
index 15beb974f3a0..c1c0b0c7e1c9 100644
--- a/drivers/bluetooth/hci_ath.c
+++ b/drivers/bluetooth/hci_ath.c
@@ -205,7 +205,7 @@ static int ath_recv(struct hci_uart *hu, const void *data, int count)
205 return count; 205 return count;
206} 206}
207 207
208static struct hci_uart_proto athp = { 208static const struct hci_uart_proto athp = {
209 .id = HCI_UART_ATH3K, 209 .id = HCI_UART_ATH3K,
210 .open = ath_open, 210 .open = ath_open,
211 .close = ath_close, 211 .close = ath_close,
diff --git a/drivers/bluetooth/hci_bcsp.c b/drivers/bluetooth/hci_bcsp.c
index 50ef2e613d59..7d30e05a973f 100644
--- a/drivers/bluetooth/hci_bcsp.c
+++ b/drivers/bluetooth/hci_bcsp.c
@@ -735,7 +735,7 @@ static int bcsp_close(struct hci_uart *hu)
735 return 0; 735 return 0;
736} 736}
737 737
738static struct hci_uart_proto bcsp = { 738static const struct hci_uart_proto bcsp = {
739 .id = HCI_UART_BCSP, 739 .id = HCI_UART_BCSP,
740 .open = bcsp_open, 740 .open = bcsp_open,
741 .close = bcsp_close, 741 .close = bcsp_close,
diff --git a/drivers/bluetooth/hci_h4.c b/drivers/bluetooth/hci_h4.c
index d8414540f743..fc783103ee36 100644
--- a/drivers/bluetooth/hci_h4.c
+++ b/drivers/bluetooth/hci_h4.c
@@ -139,7 +139,7 @@ static struct sk_buff *h4_dequeue(struct hci_uart *hu)
139 return skb_dequeue(&h4->txq); 139 return skb_dequeue(&h4->txq);
140} 140}
141 141
142static struct hci_uart_proto h4p = { 142static const struct hci_uart_proto h4p = {
143 .id = HCI_UART_H4, 143 .id = HCI_UART_H4,
144 .open = h4_open, 144 .open = h4_open,
145 .close = h4_close, 145 .close = h4_close,
diff --git a/drivers/bluetooth/hci_h5.c b/drivers/bluetooth/hci_h5.c
index 0f681cc1af64..aac0e8f718b0 100644
--- a/drivers/bluetooth/hci_h5.c
+++ b/drivers/bluetooth/hci_h5.c
@@ -743,7 +743,7 @@ static int h5_flush(struct hci_uart *hu)
743 return 0; 743 return 0;
744} 744}
745 745
746static struct hci_uart_proto h5p = { 746static const struct hci_uart_proto h5p = {
747 .id = HCI_UART_3WIRE, 747 .id = HCI_UART_3WIRE,
748 .open = h5_open, 748 .open = h5_open,
749 .close = h5_close, 749 .close = h5_close,
diff --git a/drivers/bluetooth/hci_ldisc.c b/drivers/bluetooth/hci_ldisc.c
index 50dbaf3579ed..ba3b988ce60a 100644
--- a/drivers/bluetooth/hci_ldisc.c
+++ b/drivers/bluetooth/hci_ldisc.c
@@ -48,9 +48,9 @@
48 48
49#define VERSION "2.2" 49#define VERSION "2.2"
50 50
51static struct hci_uart_proto *hup[HCI_UART_MAX_PROTO]; 51static const struct hci_uart_proto *hup[HCI_UART_MAX_PROTO];
52 52
53int hci_uart_register_proto(struct hci_uart_proto *p) 53int hci_uart_register_proto(const struct hci_uart_proto *p)
54{ 54{
55 if (p->id >= HCI_UART_MAX_PROTO) 55 if (p->id >= HCI_UART_MAX_PROTO)
56 return -EINVAL; 56 return -EINVAL;
@@ -63,7 +63,7 @@ int hci_uart_register_proto(struct hci_uart_proto *p)
63 return 0; 63 return 0;
64} 64}
65 65
66int hci_uart_unregister_proto(struct hci_uart_proto *p) 66int hci_uart_unregister_proto(const struct hci_uart_proto *p)
67{ 67{
68 if (p->id >= HCI_UART_MAX_PROTO) 68 if (p->id >= HCI_UART_MAX_PROTO)
69 return -EINVAL; 69 return -EINVAL;
@@ -76,7 +76,7 @@ int hci_uart_unregister_proto(struct hci_uart_proto *p)
76 return 0; 76 return 0;
77} 77}
78 78
79static struct hci_uart_proto *hci_uart_get_proto(unsigned int id) 79static const struct hci_uart_proto *hci_uart_get_proto(unsigned int id)
80{ 80{
81 if (id >= HCI_UART_MAX_PROTO) 81 if (id >= HCI_UART_MAX_PROTO)
82 return NULL; 82 return NULL;
@@ -506,7 +506,7 @@ static int hci_uart_register_dev(struct hci_uart *hu)
506 506
507static int hci_uart_set_proto(struct hci_uart *hu, int id) 507static int hci_uart_set_proto(struct hci_uart *hu, int id)
508{ 508{
509 struct hci_uart_proto *p; 509 const struct hci_uart_proto *p;
510 int err; 510 int err;
511 511
512 p = hci_uart_get_proto(id); 512 p = hci_uart_get_proto(id);
diff --git a/drivers/bluetooth/hci_ll.c b/drivers/bluetooth/hci_ll.c
index 79eea1cbd988..e66f0fa65485 100644
--- a/drivers/bluetooth/hci_ll.c
+++ b/drivers/bluetooth/hci_ll.c
@@ -505,7 +505,7 @@ static struct sk_buff *ll_dequeue(struct hci_uart *hu)
505 return skb_dequeue(&ll->txq); 505 return skb_dequeue(&ll->txq);
506} 506}
507 507
508static struct hci_uart_proto llp = { 508static const struct hci_uart_proto llp = {
509 .id = HCI_UART_LL, 509 .id = HCI_UART_LL,
510 .open = ll_open, 510 .open = ll_open,
511 .close = ll_close, 511 .close = ll_close,
diff --git a/drivers/bluetooth/hci_uart.h b/drivers/bluetooth/hci_uart.h
index 53b329229f2e..683153d2e9db 100644
--- a/drivers/bluetooth/hci_uart.h
+++ b/drivers/bluetooth/hci_uart.h
@@ -75,7 +75,7 @@ struct hci_uart {
75 struct work_struct init_ready; 75 struct work_struct init_ready;
76 struct work_struct write_work; 76 struct work_struct write_work;
77 77
78 struct hci_uart_proto *proto; 78 const struct hci_uart_proto *proto;
79 void *priv; 79 void *priv;
80 80
81 struct sk_buff *tx_skb; 81 struct sk_buff *tx_skb;
@@ -91,8 +91,8 @@ struct hci_uart {
91#define HCI_UART_SENDING 1 91#define HCI_UART_SENDING 1
92#define HCI_UART_TX_WAKEUP 2 92#define HCI_UART_TX_WAKEUP 2
93 93
94int hci_uart_register_proto(struct hci_uart_proto *p); 94int hci_uart_register_proto(const struct hci_uart_proto *p);
95int hci_uart_unregister_proto(struct hci_uart_proto *p); 95int hci_uart_unregister_proto(const struct hci_uart_proto *p);
96int hci_uart_tx_wakeup(struct hci_uart *hu); 96int hci_uart_tx_wakeup(struct hci_uart *hu);
97int hci_uart_init_ready(struct hci_uart *hu); 97int hci_uart_init_ready(struct hci_uart *hu);
98 98