Commit 2a4f3909 authored by Marcel Holtmann's avatar Marcel Holtmann Committed by Johan Hedberg

Bluetooth: bfusb: Switch from BT_ERR to bt_dev_err where possible

All HCI device specific error messages shall use bt_dev_err to indicate
the device name in the message.
Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
Signed-off-by: default avatarJohan Hedberg <johan.hedberg@intel.com>
parent 71811cac
...@@ -133,8 +133,8 @@ static int bfusb_send_bulk(struct bfusb_data *data, struct sk_buff *skb) ...@@ -133,8 +133,8 @@ static int bfusb_send_bulk(struct bfusb_data *data, struct sk_buff *skb)
err = usb_submit_urb(urb, GFP_ATOMIC); err = usb_submit_urb(urb, GFP_ATOMIC);
if (err) { if (err) {
BT_ERR("%s bulk tx submit failed urb %p err %d", bt_dev_err(data->hdev, "bulk tx submit failed urb %p err %d",
data->hdev->name, urb, err); urb, err);
skb_unlink(skb, &data->pending_q); skb_unlink(skb, &data->pending_q);
usb_free_urb(urb); usb_free_urb(urb);
} else } else
...@@ -232,8 +232,8 @@ static int bfusb_rx_submit(struct bfusb_data *data, struct urb *urb) ...@@ -232,8 +232,8 @@ static int bfusb_rx_submit(struct bfusb_data *data, struct urb *urb)
err = usb_submit_urb(urb, GFP_ATOMIC); err = usb_submit_urb(urb, GFP_ATOMIC);
if (err) { if (err) {
BT_ERR("%s bulk rx submit failed urb %p err %d", bt_dev_err(data->hdev, "bulk rx submit failed urb %p err %d",
data->hdev->name, urb, err); urb, err);
skb_unlink(skb, &data->pending_q); skb_unlink(skb, &data->pending_q);
kfree_skb(skb); kfree_skb(skb);
usb_free_urb(urb); usb_free_urb(urb);
...@@ -247,7 +247,7 @@ static inline int bfusb_recv_block(struct bfusb_data *data, int hdr, unsigned ch ...@@ -247,7 +247,7 @@ static inline int bfusb_recv_block(struct bfusb_data *data, int hdr, unsigned ch
BT_DBG("bfusb %p hdr 0x%02x data %p len %d", data, hdr, buf, len); BT_DBG("bfusb %p hdr 0x%02x data %p len %d", data, hdr, buf, len);
if (hdr & 0x10) { if (hdr & 0x10) {
BT_ERR("%s error in block", data->hdev->name); bt_dev_err(data->hdev, "error in block");
kfree_skb(data->reassembly); kfree_skb(data->reassembly);
data->reassembly = NULL; data->reassembly = NULL;
return -EIO; return -EIO;
...@@ -259,13 +259,13 @@ static inline int bfusb_recv_block(struct bfusb_data *data, int hdr, unsigned ch ...@@ -259,13 +259,13 @@ static inline int bfusb_recv_block(struct bfusb_data *data, int hdr, unsigned ch
int pkt_len = 0; int pkt_len = 0;
if (data->reassembly) { if (data->reassembly) {
BT_ERR("%s unexpected start block", data->hdev->name); bt_dev_err(data->hdev, "unexpected start block");
kfree_skb(data->reassembly); kfree_skb(data->reassembly);
data->reassembly = NULL; data->reassembly = NULL;
} }
if (len < 1) { if (len < 1) {
BT_ERR("%s no packet type found", data->hdev->name); bt_dev_err(data->hdev, "no packet type found");
return -EPROTO; return -EPROTO;
} }
...@@ -277,7 +277,7 @@ static inline int bfusb_recv_block(struct bfusb_data *data, int hdr, unsigned ch ...@@ -277,7 +277,7 @@ static inline int bfusb_recv_block(struct bfusb_data *data, int hdr, unsigned ch
struct hci_event_hdr *hdr = (struct hci_event_hdr *) buf; struct hci_event_hdr *hdr = (struct hci_event_hdr *) buf;
pkt_len = HCI_EVENT_HDR_SIZE + hdr->plen; pkt_len = HCI_EVENT_HDR_SIZE + hdr->plen;
} else { } else {
BT_ERR("%s event block is too short", data->hdev->name); bt_dev_err(data->hdev, "event block is too short");
return -EILSEQ; return -EILSEQ;
} }
break; break;
...@@ -287,7 +287,7 @@ static inline int bfusb_recv_block(struct bfusb_data *data, int hdr, unsigned ch ...@@ -287,7 +287,7 @@ static inline int bfusb_recv_block(struct bfusb_data *data, int hdr, unsigned ch
struct hci_acl_hdr *hdr = (struct hci_acl_hdr *) buf; struct hci_acl_hdr *hdr = (struct hci_acl_hdr *) buf;
pkt_len = HCI_ACL_HDR_SIZE + __le16_to_cpu(hdr->dlen); pkt_len = HCI_ACL_HDR_SIZE + __le16_to_cpu(hdr->dlen);
} else { } else {
BT_ERR("%s data block is too short", data->hdev->name); bt_dev_err(data->hdev, "data block is too short");
return -EILSEQ; return -EILSEQ;
} }
break; break;
...@@ -297,7 +297,7 @@ static inline int bfusb_recv_block(struct bfusb_data *data, int hdr, unsigned ch ...@@ -297,7 +297,7 @@ static inline int bfusb_recv_block(struct bfusb_data *data, int hdr, unsigned ch
struct hci_sco_hdr *hdr = (struct hci_sco_hdr *) buf; struct hci_sco_hdr *hdr = (struct hci_sco_hdr *) buf;
pkt_len = HCI_SCO_HDR_SIZE + hdr->dlen; pkt_len = HCI_SCO_HDR_SIZE + hdr->dlen;
} else { } else {
BT_ERR("%s audio block is too short", data->hdev->name); bt_dev_err(data->hdev, "audio block is too short");
return -EILSEQ; return -EILSEQ;
} }
break; break;
...@@ -305,7 +305,7 @@ static inline int bfusb_recv_block(struct bfusb_data *data, int hdr, unsigned ch ...@@ -305,7 +305,7 @@ static inline int bfusb_recv_block(struct bfusb_data *data, int hdr, unsigned ch
skb = bt_skb_alloc(pkt_len, GFP_ATOMIC); skb = bt_skb_alloc(pkt_len, GFP_ATOMIC);
if (!skb) { if (!skb) {
BT_ERR("%s no memory for the packet", data->hdev->name); bt_dev_err(data->hdev, "no memory for the packet");
return -ENOMEM; return -ENOMEM;
} }
...@@ -314,7 +314,7 @@ static inline int bfusb_recv_block(struct bfusb_data *data, int hdr, unsigned ch ...@@ -314,7 +314,7 @@ static inline int bfusb_recv_block(struct bfusb_data *data, int hdr, unsigned ch
data->reassembly = skb; data->reassembly = skb;
} else { } else {
if (!data->reassembly) { if (!data->reassembly) {
BT_ERR("%s unexpected continuation block", data->hdev->name); bt_dev_err(data->hdev, "unexpected continuation block");
return -EIO; return -EIO;
} }
} }
...@@ -366,8 +366,7 @@ static void bfusb_rx_complete(struct urb *urb) ...@@ -366,8 +366,7 @@ static void bfusb_rx_complete(struct urb *urb)
} }
if (count < len) { if (count < len) {
BT_ERR("%s block extends over URB buffer ranges", bt_dev_err(data->hdev, "block extends over URB buffer ranges");
data->hdev->name);
} }
if ((hdr & 0xe1) == 0xc1) if ((hdr & 0xe1) == 0xc1)
...@@ -391,8 +390,8 @@ static void bfusb_rx_complete(struct urb *urb) ...@@ -391,8 +390,8 @@ static void bfusb_rx_complete(struct urb *urb)
err = usb_submit_urb(urb, GFP_ATOMIC); err = usb_submit_urb(urb, GFP_ATOMIC);
if (err) { if (err) {
BT_ERR("%s bulk resubmit failed urb %p err %d", bt_dev_err(data->hdev, "bulk resubmit failed urb %p err %d",
data->hdev->name, urb, err); urb, err);
} }
unlock: unlock:
...@@ -477,7 +476,7 @@ static int bfusb_send_frame(struct hci_dev *hdev, struct sk_buff *skb) ...@@ -477,7 +476,7 @@ static int bfusb_send_frame(struct hci_dev *hdev, struct sk_buff *skb)
/* Max HCI frame size seems to be 1511 + 1 */ /* Max HCI frame size seems to be 1511 + 1 */
nskb = bt_skb_alloc(count + 32, GFP_KERNEL); nskb = bt_skb_alloc(count + 32, GFP_KERNEL);
if (!nskb) { if (!nskb) {
BT_ERR("Can't allocate memory for new packet"); bt_dev_err(hdev, "Can't allocate memory for new packet");
return -ENOMEM; return -ENOMEM;
} }
......
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