diff --git a/drivers/net/ieee802154/ca8210.c b/drivers/net/ieee802154/ca8210.c index 326243fae7e27fa93d73d2f0806b25a8f0a3ba77..24a1eabbbc9da3bf1e34a966a1b14b5f737f5a35 100644 --- a/drivers/net/ieee802154/ca8210.c +++ b/drivers/net/ieee802154/ca8210.c @@ -917,10 +917,7 @@ static int ca8210_spi_transfer( struct cas_control *cas_ctl; if (!spi) { - dev_crit( - &spi->dev, - "NULL spi device passed to ca8210_spi_transfer\n" - ); + pr_crit("NULL spi device passed to %s\n", __func__); return -ENODEV; } diff --git a/include/net/bluetooth/bluetooth.h b/include/net/bluetooth/bluetooth.h index 01487192f628af6200f9187cb4aa462a05df2093..020142bb9735b80d884bffb4d5f50a7be4826974 100644 --- a/include/net/bluetooth/bluetooth.h +++ b/include/net/bluetooth/bluetooth.h @@ -233,7 +233,7 @@ static inline void bacpy(bdaddr_t *dst, const bdaddr_t *src) memcpy(dst, src, sizeof(bdaddr_t)); } -void baswap(bdaddr_t *dst, bdaddr_t *src); +void baswap(bdaddr_t *dst, const bdaddr_t *src); /* Common socket structures and functions */ diff --git a/net/bluetooth/Kconfig b/net/bluetooth/Kconfig index db82a40875e8da3c9ad39881046d27bd8f0ee596..c18115d22f00be37f68d9bbdbb04f626de6cf3c4 100644 --- a/net/bluetooth/Kconfig +++ b/net/bluetooth/Kconfig @@ -126,4 +126,14 @@ config BT_DEBUGFS Provide extensive information about internal Bluetooth states in debugfs. +config BT_LEGACY_IOCTL + bool "Enable legacy ioctl interfaces" + depends on BT && BT_BREDR + default y + help + Enable support for legacy ioctl interfaces. This is only needed + for old and deprecated applications using direct ioctl calls for + controller management. Since Linux 3.4 all configuration and + setup is done via mgmt interface and this is no longer needed. + source "drivers/bluetooth/Kconfig" diff --git a/net/bluetooth/hci_sock.c b/net/bluetooth/hci_sock.c index 65d734c165bd6368b8607d0b5078d345b5e642a8..0bad296fe0af970f5989b8a121039b99863088b9 100644 --- a/net/bluetooth/hci_sock.c +++ b/net/bluetooth/hci_sock.c @@ -878,6 +878,7 @@ static int hci_sock_release(struct socket *sock) return 0; } +#ifdef CONFIG_BT_LEGACY_IOCTL static int hci_sock_blacklist_add(struct hci_dev *hdev, void __user *arg) { bdaddr_t bdaddr; @@ -1049,6 +1050,7 @@ static int hci_sock_ioctl(struct socket *sock, unsigned int cmd, release_sock(sk); return err; } +#endif static int hci_sock_bind(struct socket *sock, struct sockaddr *addr, int addr_len) @@ -1969,7 +1971,11 @@ static const struct proto_ops hci_sock_ops = { .getname = hci_sock_getname, .sendmsg = hci_sock_sendmsg, .recvmsg = hci_sock_recvmsg, +#ifdef CONFIG_BT_LEGACY_IOCTL .ioctl = hci_sock_ioctl, +#else + .ioctl = sock_no_ioctl, +#endif .poll = datagram_poll, .listen = sock_no_listen, .shutdown = sock_no_shutdown, diff --git a/net/bluetooth/hci_sysfs.c b/net/bluetooth/hci_sysfs.c index ca7a35ebaefb61095f278106adc8d5529a247d31..aa300f3a0d51bda11c13766abbc536e33f2e0a2d 100644 --- a/net/bluetooth/hci_sysfs.c +++ b/net/bluetooth/hci_sysfs.c @@ -13,7 +13,7 @@ static void bt_link_release(struct device *dev) kfree(conn); } -static struct device_type bt_link = { +static const struct device_type bt_link = { .name = "link", .release = bt_link_release, }; @@ -86,7 +86,7 @@ static void bt_host_release(struct device *dev) module_put(THIS_MODULE); } -static struct device_type bt_host = { +static const struct device_type bt_host = { .name = "host", .release = bt_host_release, }; diff --git a/net/bluetooth/lib.c b/net/bluetooth/lib.c index aa4cf64e32a67b9263d0c5729b8f2f73289f22f1..63e65d9b4b24c648edb4927f943e5fce59180f5f 100644 --- a/net/bluetooth/lib.c +++ b/net/bluetooth/lib.c @@ -30,10 +30,10 @@ #include <net/bluetooth/bluetooth.h> -void baswap(bdaddr_t *dst, bdaddr_t *src) +void baswap(bdaddr_t *dst, const bdaddr_t *src) { - unsigned char *d = (unsigned char *) dst; - unsigned char *s = (unsigned char *) src; + const unsigned char *s = (const unsigned char *)src; + unsigned char *d = (unsigned char *)dst; unsigned int i; for (i = 0; i < 6; i++) diff --git a/net/ieee802154/6lowpan/core.c b/net/ieee802154/6lowpan/core.c index de2661cd0328500414c652af202a8928bd9ad89c..974765b7d92a75546fe5ae5dbc332078a54f627a 100644 --- a/net/ieee802154/6lowpan/core.c +++ b/net/ieee802154/6lowpan/core.c @@ -54,7 +54,7 @@ static int open_count; -static struct header_ops lowpan_header_ops = { +static const struct header_ops lowpan_header_ops = { .create = lowpan_header_create, };