Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4ee7ef19 authored by Marcel Holtmann's avatar Marcel Holtmann
Browse files

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: default avatarMarcel Holtmann <marcel@holtmann.org>
Signed-off-by: default avatarJohan Hedberg <johan.hedberg@intel.com>
parent 2d7cc19e
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -205,7 +205,7 @@ static int ath_recv(struct hci_uart *hu, const void *data, int count)
	return count;
}

static struct hci_uart_proto athp = {
static const struct hci_uart_proto athp = {
	.id = HCI_UART_ATH3K,
	.open = ath_open,
	.close = ath_close,
+1 −1
Original line number Diff line number Diff line
@@ -735,7 +735,7 @@ static int bcsp_close(struct hci_uart *hu)
	return 0;
}

static struct hci_uart_proto bcsp = {
static const struct hci_uart_proto bcsp = {
	.id		= HCI_UART_BCSP,
	.open		= bcsp_open,
	.close		= bcsp_close,
+1 −1
Original line number Diff line number Diff line
@@ -139,7 +139,7 @@ static struct sk_buff *h4_dequeue(struct hci_uart *hu)
	return skb_dequeue(&h4->txq);
}

static struct hci_uart_proto h4p = {
static const struct hci_uart_proto h4p = {
	.id		= HCI_UART_H4,
	.open		= h4_open,
	.close		= h4_close,
+1 −1
Original line number Diff line number Diff line
@@ -743,7 +743,7 @@ static int h5_flush(struct hci_uart *hu)
	return 0;
}

static struct hci_uart_proto h5p = {
static const struct hci_uart_proto h5p = {
	.id		= HCI_UART_3WIRE,
	.open		= h5_open,
	.close		= h5_close,
+5 −5
Original line number Diff line number Diff line
@@ -48,9 +48,9 @@

#define VERSION "2.2"

static struct hci_uart_proto *hup[HCI_UART_MAX_PROTO];
static const struct hci_uart_proto *hup[HCI_UART_MAX_PROTO];

int hci_uart_register_proto(struct hci_uart_proto *p)
int hci_uart_register_proto(const struct hci_uart_proto *p)
{
	if (p->id >= HCI_UART_MAX_PROTO)
		return -EINVAL;
@@ -63,7 +63,7 @@ int hci_uart_register_proto(struct hci_uart_proto *p)
	return 0;
}

int hci_uart_unregister_proto(struct hci_uart_proto *p)
int hci_uart_unregister_proto(const struct hci_uart_proto *p)
{
	if (p->id >= HCI_UART_MAX_PROTO)
		return -EINVAL;
@@ -76,7 +76,7 @@ int hci_uart_unregister_proto(struct hci_uart_proto *p)
	return 0;
}

static struct hci_uart_proto *hci_uart_get_proto(unsigned int id)
static const struct hci_uart_proto *hci_uart_get_proto(unsigned int id)
{
	if (id >= HCI_UART_MAX_PROTO)
		return NULL;
@@ -506,7 +506,7 @@ static int hci_uart_register_dev(struct hci_uart *hu)

static int hci_uart_set_proto(struct hci_uart *hu, int id)
{
	struct hci_uart_proto *p;
	const struct hci_uart_proto *p;
	int err;

	p = hci_uart_get_proto(id);
Loading