Commit 7b22a778 authored by David S. Miller's avatar David S. Miller

Merge branch 'for-upstream' of...

Merge branch 'for-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next

Johan Hedberg says:

====================
pull request: bluetooth-next 2015-12-31

Here's (probably) the last bluetooth-next pull request for the 4.5
kernel:

 - Add support for BCM2E65 ACPI ID
 - Minor fixes/cleanups in the bcm203x & bfusb drivers
 - Minor debugfs related fix in 6lowpan code

Please let me know if there are any issues pulling. Thanks.
====================
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents ccac0425 7ddb6922
...@@ -178,10 +178,8 @@ static int bcm203x_probe(struct usb_interface *intf, const struct usb_device_id ...@@ -178,10 +178,8 @@ static int bcm203x_probe(struct usb_interface *intf, const struct usb_device_id
return -ENODEV; return -ENODEV;
data = devm_kzalloc(&intf->dev, sizeof(*data), GFP_KERNEL); data = devm_kzalloc(&intf->dev, sizeof(*data), GFP_KERNEL);
if (!data) { if (!data)
BT_ERR("Can't allocate memory for data structure");
return -ENOMEM; return -ENOMEM;
}
data->udev = udev; data->udev = udev;
data->state = BCM203X_LOAD_MINIDRV; data->state = BCM203X_LOAD_MINIDRV;
......
...@@ -636,10 +636,8 @@ static int bfusb_probe(struct usb_interface *intf, const struct usb_device_id *i ...@@ -636,10 +636,8 @@ static int bfusb_probe(struct usb_interface *intf, const struct usb_device_id *i
/* Initialize control structure and load firmware */ /* Initialize control structure and load firmware */
data = devm_kzalloc(&intf->dev, sizeof(struct bfusb_data), GFP_KERNEL); data = devm_kzalloc(&intf->dev, sizeof(struct bfusb_data), GFP_KERNEL);
if (!data) { if (!data)
BT_ERR("Can't allocate memory for control structure"); return -ENOMEM;
goto done;
}
data->udev = udev; data->udev = udev;
data->bulk_in_ep = bulk_in_ep->desc.bEndpointAddress; data->bulk_in_ep = bulk_in_ep->desc.bEndpointAddress;
......
...@@ -815,6 +815,7 @@ static const struct hci_uart_proto bcm_proto = { ...@@ -815,6 +815,7 @@ static const struct hci_uart_proto bcm_proto = {
#ifdef CONFIG_ACPI #ifdef CONFIG_ACPI
static const struct acpi_device_id bcm_acpi_match[] = { static const struct acpi_device_id bcm_acpi_match[] = {
{ "BCM2E39", 0 }, { "BCM2E39", 0 },
{ "BCM2E65", 0 },
{ "BCM2E67", 0 }, { "BCM2E67", 0 },
{ }, { },
}; };
......
...@@ -29,13 +29,13 @@ int lowpan_register_netdevice(struct net_device *dev, ...@@ -29,13 +29,13 @@ int lowpan_register_netdevice(struct net_device *dev,
lowpan_priv(dev)->lltype = lltype; lowpan_priv(dev)->lltype = lltype;
ret = lowpan_dev_debugfs_init(dev); ret = register_netdevice(dev);
if (ret < 0) if (ret < 0)
return ret; return ret;
ret = register_netdevice(dev); ret = lowpan_dev_debugfs_init(dev);
if (ret < 0) if (ret < 0)
lowpan_dev_debugfs_exit(dev); unregister_netdevice(dev);
return ret; return ret;
} }
......
...@@ -174,13 +174,13 @@ EXPORT_SYMBOL(bt_accept_unlink); ...@@ -174,13 +174,13 @@ EXPORT_SYMBOL(bt_accept_unlink);
struct sock *bt_accept_dequeue(struct sock *parent, struct socket *newsock) struct sock *bt_accept_dequeue(struct sock *parent, struct socket *newsock)
{ {
struct list_head *p, *n; struct bt_sock *s, *n;
struct sock *sk; struct sock *sk;
BT_DBG("parent %p", parent); BT_DBG("parent %p", parent);
list_for_each_safe(p, n, &bt_sk(parent)->accept_q) { list_for_each_entry_safe(s, n, &bt_sk(parent)->accept_q, accept_q) {
sk = (struct sock *) list_entry(p, struct bt_sock, accept_q); sk = (struct sock *)s;
lock_sock(sk); lock_sock(sk);
...@@ -388,11 +388,11 @@ EXPORT_SYMBOL(bt_sock_stream_recvmsg); ...@@ -388,11 +388,11 @@ EXPORT_SYMBOL(bt_sock_stream_recvmsg);
static inline unsigned int bt_accept_poll(struct sock *parent) static inline unsigned int bt_accept_poll(struct sock *parent)
{ {
struct list_head *p, *n; struct bt_sock *s, *n;
struct sock *sk; struct sock *sk;
list_for_each_safe(p, n, &bt_sk(parent)->accept_q) { list_for_each_entry_safe(s, n, &bt_sk(parent)->accept_q, accept_q) {
sk = (struct sock *) list_entry(p, struct bt_sock, accept_q); sk = (struct sock *)s;
if (sk->sk_state == BT_CONNECTED || if (sk->sk_state == BT_CONNECTED ||
(test_bit(BT_SK_DEFER_SETUP, &bt_sk(parent)->flags) && (test_bit(BT_SK_DEFER_SETUP, &bt_sk(parent)->flags) &&
sk->sk_state == BT_CONNECT2)) sk->sk_state == BT_CONNECT2))
......
...@@ -100,10 +100,8 @@ static void cmtp_application_del(struct cmtp_session *session, struct cmtp_appli ...@@ -100,10 +100,8 @@ static void cmtp_application_del(struct cmtp_session *session, struct cmtp_appli
static struct cmtp_application *cmtp_application_get(struct cmtp_session *session, int pattern, __u16 value) static struct cmtp_application *cmtp_application_get(struct cmtp_session *session, int pattern, __u16 value)
{ {
struct cmtp_application *app; struct cmtp_application *app;
struct list_head *p;
list_for_each(p, &session->applications) { list_for_each_entry(app, &session->applications, list) {
app = list_entry(p, struct cmtp_application, list);
switch (pattern) { switch (pattern) {
case CMTP_MSGNUM: case CMTP_MSGNUM:
if (app->msgnum == value) if (app->msgnum == value)
...@@ -511,14 +509,12 @@ static int cmtp_proc_show(struct seq_file *m, void *v) ...@@ -511,14 +509,12 @@ static int cmtp_proc_show(struct seq_file *m, void *v)
struct capi_ctr *ctrl = m->private; struct capi_ctr *ctrl = m->private;
struct cmtp_session *session = ctrl->driverdata; struct cmtp_session *session = ctrl->driverdata;
struct cmtp_application *app; struct cmtp_application *app;
struct list_head *p;
seq_printf(m, "%s\n\n", cmtp_procinfo(ctrl)); seq_printf(m, "%s\n\n", cmtp_procinfo(ctrl));
seq_printf(m, "addr %s\n", session->name); seq_printf(m, "addr %s\n", session->name);
seq_printf(m, "ctrl %d\n", session->num); seq_printf(m, "ctrl %d\n", session->num);
list_for_each(p, &session->applications) { list_for_each_entry(app, &session->applications, list) {
app = list_entry(p, struct cmtp_application, list);
seq_printf(m, "appl %d -> %d\n", app->appl, app->mapping); seq_printf(m, "appl %d -> %d\n", app->appl, app->mapping);
} }
......
...@@ -2713,12 +2713,10 @@ struct bdaddr_list *hci_bdaddr_list_lookup(struct list_head *bdaddr_list, ...@@ -2713,12 +2713,10 @@ struct bdaddr_list *hci_bdaddr_list_lookup(struct list_head *bdaddr_list,
void hci_bdaddr_list_clear(struct list_head *bdaddr_list) void hci_bdaddr_list_clear(struct list_head *bdaddr_list)
{ {
struct list_head *p, *n; struct bdaddr_list *b, *n;
list_for_each_safe(p, n, bdaddr_list) { list_for_each_entry_safe(b, n, bdaddr_list, list) {
struct bdaddr_list *b = list_entry(p, struct bdaddr_list, list); list_del(&b->list);
list_del(p);
kfree(b); kfree(b);
} }
} }
......
...@@ -692,11 +692,9 @@ static struct rfcomm_session *rfcomm_session_del(struct rfcomm_session *s) ...@@ -692,11 +692,9 @@ static struct rfcomm_session *rfcomm_session_del(struct rfcomm_session *s)
static struct rfcomm_session *rfcomm_session_get(bdaddr_t *src, bdaddr_t *dst) static struct rfcomm_session *rfcomm_session_get(bdaddr_t *src, bdaddr_t *dst)
{ {
struct rfcomm_session *s; struct rfcomm_session *s, *n;
struct list_head *p, *n;
struct l2cap_chan *chan; struct l2cap_chan *chan;
list_for_each_safe(p, n, &session_list) { list_for_each_entry_safe(s, n, &session_list, list) {
s = list_entry(p, struct rfcomm_session, list);
chan = l2cap_pi(s->sock->sk)->chan; chan = l2cap_pi(s->sock->sk)->chan;
if ((!bacmp(src, BDADDR_ANY) || !bacmp(&chan->src, src)) && if ((!bacmp(src, BDADDR_ANY) || !bacmp(&chan->src, src)) &&
...@@ -709,16 +707,14 @@ static struct rfcomm_session *rfcomm_session_get(bdaddr_t *src, bdaddr_t *dst) ...@@ -709,16 +707,14 @@ static struct rfcomm_session *rfcomm_session_get(bdaddr_t *src, bdaddr_t *dst)
static struct rfcomm_session *rfcomm_session_close(struct rfcomm_session *s, static struct rfcomm_session *rfcomm_session_close(struct rfcomm_session *s,
int err) int err)
{ {
struct rfcomm_dlc *d; struct rfcomm_dlc *d, *n;
struct list_head *p, *n;
s->state = BT_CLOSED; s->state = BT_CLOSED;
BT_DBG("session %p state %ld err %d", s, s->state, err); BT_DBG("session %p state %ld err %d", s, s->state, err);
/* Close all dlcs */ /* Close all dlcs */
list_for_each_safe(p, n, &s->dlcs) { list_for_each_entry_safe(d, n, &s->dlcs, list) {
d = list_entry(p, struct rfcomm_dlc, list);
d->state = BT_CLOSED; d->state = BT_CLOSED;
__rfcomm_dlc_close(d, err); __rfcomm_dlc_close(d, err);
} }
...@@ -1771,13 +1767,11 @@ static struct rfcomm_session *rfcomm_recv_frame(struct rfcomm_session *s, ...@@ -1771,13 +1767,11 @@ static struct rfcomm_session *rfcomm_recv_frame(struct rfcomm_session *s,
static void rfcomm_process_connect(struct rfcomm_session *s) static void rfcomm_process_connect(struct rfcomm_session *s)
{ {
struct rfcomm_dlc *d; struct rfcomm_dlc *d, *n;
struct list_head *p, *n;
BT_DBG("session %p state %ld", s, s->state); BT_DBG("session %p state %ld", s, s->state);
list_for_each_safe(p, n, &s->dlcs) { list_for_each_entry_safe(d, n, &s->dlcs, list) {
d = list_entry(p, struct rfcomm_dlc, list);
if (d->state == BT_CONFIG) { if (d->state == BT_CONFIG) {
d->mtu = s->mtu; d->mtu = s->mtu;
if (rfcomm_check_security(d)) { if (rfcomm_check_security(d)) {
...@@ -1843,14 +1837,11 @@ static int rfcomm_process_tx(struct rfcomm_dlc *d) ...@@ -1843,14 +1837,11 @@ static int rfcomm_process_tx(struct rfcomm_dlc *d)
static void rfcomm_process_dlcs(struct rfcomm_session *s) static void rfcomm_process_dlcs(struct rfcomm_session *s)
{ {
struct rfcomm_dlc *d; struct rfcomm_dlc *d, *n;
struct list_head *p, *n;
BT_DBG("session %p state %ld", s, s->state); BT_DBG("session %p state %ld", s, s->state);
list_for_each_safe(p, n, &s->dlcs) { list_for_each_entry_safe(d, n, &s->dlcs, list) {
d = list_entry(p, struct rfcomm_dlc, list);
if (test_bit(RFCOMM_TIMED_OUT, &d->flags)) { if (test_bit(RFCOMM_TIMED_OUT, &d->flags)) {
__rfcomm_dlc_close(d, ETIMEDOUT); __rfcomm_dlc_close(d, ETIMEDOUT);
continue; continue;
...@@ -1985,14 +1976,11 @@ static struct rfcomm_session *rfcomm_check_connection(struct rfcomm_session *s) ...@@ -1985,14 +1976,11 @@ static struct rfcomm_session *rfcomm_check_connection(struct rfcomm_session *s)
static void rfcomm_process_sessions(void) static void rfcomm_process_sessions(void)
{ {
struct list_head *p, *n; struct rfcomm_session *s, *n;
rfcomm_lock(); rfcomm_lock();
list_for_each_safe(p, n, &session_list) { list_for_each_entry_safe(s, n, &session_list, list) {
struct rfcomm_session *s;
s = list_entry(p, struct rfcomm_session, list);
if (test_and_clear_bit(RFCOMM_TIMED_OUT, &s->flags)) { if (test_and_clear_bit(RFCOMM_TIMED_OUT, &s->flags)) {
s->state = BT_DISCONN; s->state = BT_DISCONN;
rfcomm_send_disc(s, 0); rfcomm_send_disc(s, 0);
...@@ -2075,15 +2063,12 @@ static int rfcomm_add_listener(bdaddr_t *ba) ...@@ -2075,15 +2063,12 @@ static int rfcomm_add_listener(bdaddr_t *ba)
static void rfcomm_kill_listener(void) static void rfcomm_kill_listener(void)
{ {
struct rfcomm_session *s; struct rfcomm_session *s, *n;
struct list_head *p, *n;
BT_DBG(""); BT_DBG("");
list_for_each_safe(p, n, &session_list) { list_for_each_entry_safe(s, n, &session_list, list)
s = list_entry(p, struct rfcomm_session, list);
rfcomm_session_del(s); rfcomm_session_del(s);
}
} }
static int rfcomm_run(void *unused) static int rfcomm_run(void *unused)
...@@ -2113,8 +2098,7 @@ static int rfcomm_run(void *unused) ...@@ -2113,8 +2098,7 @@ static int rfcomm_run(void *unused)
static void rfcomm_security_cfm(struct hci_conn *conn, u8 status, u8 encrypt) static void rfcomm_security_cfm(struct hci_conn *conn, u8 status, u8 encrypt)
{ {
struct rfcomm_session *s; struct rfcomm_session *s;
struct rfcomm_dlc *d; struct rfcomm_dlc *d, *n;
struct list_head *p, *n;
BT_DBG("conn %p status 0x%02x encrypt 0x%02x", conn, status, encrypt); BT_DBG("conn %p status 0x%02x encrypt 0x%02x", conn, status, encrypt);
...@@ -2122,9 +2106,7 @@ static void rfcomm_security_cfm(struct hci_conn *conn, u8 status, u8 encrypt) ...@@ -2122,9 +2106,7 @@ static void rfcomm_security_cfm(struct hci_conn *conn, u8 status, u8 encrypt)
if (!s) if (!s)
return; return;
list_for_each_safe(p, n, &s->dlcs) { list_for_each_entry_safe(d, n, &s->dlcs, list) {
d = list_entry(p, struct rfcomm_dlc, list);
if (test_and_clear_bit(RFCOMM_SEC_PENDING, &d->flags)) { if (test_and_clear_bit(RFCOMM_SEC_PENDING, &d->flags)) {
rfcomm_dlc_clear_timer(d); rfcomm_dlc_clear_timer(d);
if (status || encrypt == 0x00) { if (status || encrypt == 0x00) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment