Skip to content

Commit 2a4f390

Browse files
holtmannjhedberg
authored andcommitted
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: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
1 parent 71811ca commit 2a4f390

1 file changed

Lines changed: 16 additions & 17 deletions

File tree

‎drivers/bluetooth/bfusb.c‎

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -133,8 +133,8 @@ static int bfusb_send_bulk(struct bfusb_data *data, struct sk_buff *skb)
133133

134134
err = usb_submit_urb(urb, GFP_ATOMIC);
135135
if (err) {
136-
BT_ERR("%s bulk tx submit failed urb %p err %d",
137-
data->hdev->name, urb, err);
136+
bt_dev_err(data->hdev, "bulk tx submit failed urb %p err %d",
137+
urb, err);
138138
skb_unlink(skb, &data->pending_q);
139139
usb_free_urb(urb);
140140
} else
@@ -232,8 +232,8 @@ static int bfusb_rx_submit(struct bfusb_data *data, struct urb *urb)
232232

233233
err = usb_submit_urb(urb, GFP_ATOMIC);
234234
if (err) {
235-
BT_ERR("%s bulk rx submit failed urb %p err %d",
236-
data->hdev->name, urb, err);
235+
bt_dev_err(data->hdev, "bulk rx submit failed urb %p err %d",
236+
urb, err);
237237
skb_unlink(skb, &data->pending_q);
238238
kfree_skb(skb);
239239
usb_free_urb(urb);
@@ -247,7 +247,7 @@ static inline int bfusb_recv_block(struct bfusb_data *data, int hdr, unsigned ch
247247
BT_DBG("bfusb %p hdr 0x%02x data %p len %d", data, hdr, buf, len);
248248

249249
if (hdr & 0x10) {
250-
BT_ERR("%s error in block", data->hdev->name);
250+
bt_dev_err(data->hdev, "error in block");
251251
kfree_skb(data->reassembly);
252252
data->reassembly = NULL;
253253
return -EIO;
@@ -259,13 +259,13 @@ static inline int bfusb_recv_block(struct bfusb_data *data, int hdr, unsigned ch
259259
int pkt_len = 0;
260260

261261
if (data->reassembly) {
262-
BT_ERR("%s unexpected start block", data->hdev->name);
262+
bt_dev_err(data->hdev, "unexpected start block");
263263
kfree_skb(data->reassembly);
264264
data->reassembly = NULL;
265265
}
266266

267267
if (len < 1) {
268-
BT_ERR("%s no packet type found", data->hdev->name);
268+
bt_dev_err(data->hdev, "no packet type found");
269269
return -EPROTO;
270270
}
271271

@@ -277,7 +277,7 @@ static inline int bfusb_recv_block(struct bfusb_data *data, int hdr, unsigned ch
277277
struct hci_event_hdr *hdr = (struct hci_event_hdr *) buf;
278278
pkt_len = HCI_EVENT_HDR_SIZE + hdr->plen;
279279
} else {
280-
BT_ERR("%s event block is too short", data->hdev->name);
280+
bt_dev_err(data->hdev, "event block is too short");
281281
return -EILSEQ;
282282
}
283283
break;
@@ -287,7 +287,7 @@ static inline int bfusb_recv_block(struct bfusb_data *data, int hdr, unsigned ch
287287
struct hci_acl_hdr *hdr = (struct hci_acl_hdr *) buf;
288288
pkt_len = HCI_ACL_HDR_SIZE + __le16_to_cpu(hdr->dlen);
289289
} else {
290-
BT_ERR("%s data block is too short", data->hdev->name);
290+
bt_dev_err(data->hdev, "data block is too short");
291291
return -EILSEQ;
292292
}
293293
break;
@@ -297,15 +297,15 @@ static inline int bfusb_recv_block(struct bfusb_data *data, int hdr, unsigned ch
297297
struct hci_sco_hdr *hdr = (struct hci_sco_hdr *) buf;
298298
pkt_len = HCI_SCO_HDR_SIZE + hdr->dlen;
299299
} else {
300-
BT_ERR("%s audio block is too short", data->hdev->name);
300+
bt_dev_err(data->hdev, "audio block is too short");
301301
return -EILSEQ;
302302
}
303303
break;
304304
}
305305

306306
skb = bt_skb_alloc(pkt_len, GFP_ATOMIC);
307307
if (!skb) {
308-
BT_ERR("%s no memory for the packet", data->hdev->name);
308+
bt_dev_err(data->hdev, "no memory for the packet");
309309
return -ENOMEM;
310310
}
311311

@@ -314,7 +314,7 @@ static inline int bfusb_recv_block(struct bfusb_data *data, int hdr, unsigned ch
314314
data->reassembly = skb;
315315
} else {
316316
if (!data->reassembly) {
317-
BT_ERR("%s unexpected continuation block", data->hdev->name);
317+
bt_dev_err(data->hdev, "unexpected continuation block");
318318
return -EIO;
319319
}
320320
}
@@ -366,8 +366,7 @@ static void bfusb_rx_complete(struct urb *urb)
366366
}
367367

368368
if (count < len) {
369-
BT_ERR("%s block extends over URB buffer ranges",
370-
data->hdev->name);
369+
bt_dev_err(data->hdev, "block extends over URB buffer ranges");
371370
}
372371

373372
if ((hdr & 0xe1) == 0xc1)
@@ -391,8 +390,8 @@ static void bfusb_rx_complete(struct urb *urb)
391390

392391
err = usb_submit_urb(urb, GFP_ATOMIC);
393392
if (err) {
394-
BT_ERR("%s bulk resubmit failed urb %p err %d",
395-
data->hdev->name, urb, err);
393+
bt_dev_err(data->hdev, "bulk resubmit failed urb %p err %d",
394+
urb, err);
396395
}
397396

398397
unlock:
@@ -477,7 +476,7 @@ static int bfusb_send_frame(struct hci_dev *hdev, struct sk_buff *skb)
477476
/* Max HCI frame size seems to be 1511 + 1 */
478477
nskb = bt_skb_alloc(count + 32, GFP_KERNEL);
479478
if (!nskb) {
480-
BT_ERR("Can't allocate memory for new packet");
479+
bt_dev_err(hdev, "Can't allocate memory for new packet");
481480
return -ENOMEM;
482481
}
483482

0 commit comments

Comments
 (0)