Commit 89e7533d authored by Marcel Holtmann's avatar Marcel Holtmann Committed by Johan Hedberg

Bluetooth: btusb: Fix old coding style issues

The btusb driver has been around for a while now and it is time to
bring its coding style in sync with what has been done for the
Bluetooth subsystem and other drivers.
Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
Signed-off-by: default avatarJohan Hedberg <johan.hedberg@intel.com>
parent 6970c34c
...@@ -302,8 +302,8 @@ static void btusb_intr_complete(struct urb *urb) ...@@ -302,8 +302,8 @@ static void btusb_intr_complete(struct urb *urb)
struct btusb_data *data = hci_get_drvdata(hdev); struct btusb_data *data = hci_get_drvdata(hdev);
int err; int err;
BT_DBG("%s urb %p status %d count %d", hdev->name, BT_DBG("%s urb %p status %d count %d", hdev->name, urb, urb->status,
urb, urb->status, urb->actual_length); urb->actual_length);
if (!test_bit(HCI_RUNNING, &hdev->flags)) if (!test_bit(HCI_RUNNING, &hdev->flags))
return; return;
...@@ -367,8 +367,7 @@ static int btusb_submit_intr_urb(struct hci_dev *hdev, gfp_t mem_flags) ...@@ -367,8 +367,7 @@ static int btusb_submit_intr_urb(struct hci_dev *hdev, gfp_t mem_flags)
pipe = usb_rcvintpipe(data->udev, data->intr_ep->bEndpointAddress); pipe = usb_rcvintpipe(data->udev, data->intr_ep->bEndpointAddress);
usb_fill_int_urb(urb, data->udev, pipe, buf, size, usb_fill_int_urb(urb, data->udev, pipe, buf, size,
btusb_intr_complete, hdev, btusb_intr_complete, hdev, data->intr_ep->bInterval);
data->intr_ep->bInterval);
urb->transfer_flags |= URB_FREE_BUFFER; urb->transfer_flags |= URB_FREE_BUFFER;
...@@ -393,8 +392,8 @@ static void btusb_bulk_complete(struct urb *urb) ...@@ -393,8 +392,8 @@ static void btusb_bulk_complete(struct urb *urb)
struct btusb_data *data = hci_get_drvdata(hdev); struct btusb_data *data = hci_get_drvdata(hdev);
int err; int err;
BT_DBG("%s urb %p status %d count %d", hdev->name, BT_DBG("%s urb %p status %d count %d", hdev->name, urb, urb->status,
urb, urb->status, urb->actual_length); urb->actual_length);
if (!test_bit(HCI_RUNNING, &hdev->flags)) if (!test_bit(HCI_RUNNING, &hdev->flags))
return; return;
...@@ -455,8 +454,8 @@ static int btusb_submit_bulk_urb(struct hci_dev *hdev, gfp_t mem_flags) ...@@ -455,8 +454,8 @@ static int btusb_submit_bulk_urb(struct hci_dev *hdev, gfp_t mem_flags)
pipe = usb_rcvbulkpipe(data->udev, data->bulk_rx_ep->bEndpointAddress); pipe = usb_rcvbulkpipe(data->udev, data->bulk_rx_ep->bEndpointAddress);
usb_fill_bulk_urb(urb, data->udev, pipe, usb_fill_bulk_urb(urb, data->udev, pipe, buf, size,
buf, size, btusb_bulk_complete, hdev); btusb_bulk_complete, hdev);
urb->transfer_flags |= URB_FREE_BUFFER; urb->transfer_flags |= URB_FREE_BUFFER;
...@@ -482,8 +481,8 @@ static void btusb_isoc_complete(struct urb *urb) ...@@ -482,8 +481,8 @@ static void btusb_isoc_complete(struct urb *urb)
struct btusb_data *data = hci_get_drvdata(hdev); struct btusb_data *data = hci_get_drvdata(hdev);
int i, err; int i, err;
BT_DBG("%s urb %p status %d count %d", hdev->name, BT_DBG("%s urb %p status %d count %d", hdev->name, urb, urb->status,
urb, urb->status, urb->actual_length); urb->actual_length);
if (!test_bit(HCI_RUNNING, &hdev->flags)) if (!test_bit(HCI_RUNNING, &hdev->flags))
return; return;
...@@ -601,11 +600,11 @@ static int btusb_submit_isoc_urb(struct hci_dev *hdev, gfp_t mem_flags) ...@@ -601,11 +600,11 @@ static int btusb_submit_isoc_urb(struct hci_dev *hdev, gfp_t mem_flags)
static void btusb_tx_complete(struct urb *urb) static void btusb_tx_complete(struct urb *urb)
{ {
struct sk_buff *skb = urb->context; struct sk_buff *skb = urb->context;
struct hci_dev *hdev = (struct hci_dev *) skb->dev; struct hci_dev *hdev = (struct hci_dev *)skb->dev;
struct btusb_data *data = hci_get_drvdata(hdev); struct btusb_data *data = hci_get_drvdata(hdev);
BT_DBG("%s urb %p status %d count %d", hdev->name, BT_DBG("%s urb %p status %d count %d", hdev->name, urb, urb->status,
urb, urb->status, urb->actual_length); urb->actual_length);
if (!test_bit(HCI_RUNNING, &hdev->flags)) if (!test_bit(HCI_RUNNING, &hdev->flags))
goto done; goto done;
...@@ -628,10 +627,10 @@ static void btusb_tx_complete(struct urb *urb) ...@@ -628,10 +627,10 @@ static void btusb_tx_complete(struct urb *urb)
static void btusb_isoc_tx_complete(struct urb *urb) static void btusb_isoc_tx_complete(struct urb *urb)
{ {
struct sk_buff *skb = urb->context; struct sk_buff *skb = urb->context;
struct hci_dev *hdev = (struct hci_dev *) skb->dev; struct hci_dev *hdev = (struct hci_dev *)skb->dev;
BT_DBG("%s urb %p status %d count %d", hdev->name, BT_DBG("%s urb %p status %d count %d", hdev->name, urb, urb->status,
urb, urb->status, urb->actual_length); urb->actual_length);
if (!test_bit(HCI_RUNNING, &hdev->flags)) if (!test_bit(HCI_RUNNING, &hdev->flags))
goto done; goto done;
...@@ -763,10 +762,10 @@ static struct urb *alloc_ctrl_urb(struct hci_dev *hdev, struct sk_buff *skb) ...@@ -763,10 +762,10 @@ static struct urb *alloc_ctrl_urb(struct hci_dev *hdev, struct sk_buff *skb)
pipe = usb_sndctrlpipe(data->udev, 0x00); pipe = usb_sndctrlpipe(data->udev, 0x00);
usb_fill_control_urb(urb, data->udev, pipe, (void *) dr, usb_fill_control_urb(urb, data->udev, pipe, (void *)dr,
skb->data, skb->len, btusb_tx_complete, skb); skb->data, skb->len, btusb_tx_complete, skb);
skb->dev = (void *) hdev; skb->dev = (void *)hdev;
return urb; return urb;
} }
...@@ -789,7 +788,7 @@ static struct urb *alloc_bulk_urb(struct hci_dev *hdev, struct sk_buff *skb) ...@@ -789,7 +788,7 @@ static struct urb *alloc_bulk_urb(struct hci_dev *hdev, struct sk_buff *skb)
usb_fill_bulk_urb(urb, data->udev, pipe, usb_fill_bulk_urb(urb, data->udev, pipe,
skb->data, skb->len, btusb_tx_complete, skb); skb->data, skb->len, btusb_tx_complete, skb);
skb->dev = (void *) hdev; skb->dev = (void *)hdev;
return urb; return urb;
} }
...@@ -818,7 +817,7 @@ static struct urb *alloc_isoc_urb(struct hci_dev *hdev, struct sk_buff *skb) ...@@ -818,7 +817,7 @@ static struct urb *alloc_isoc_urb(struct hci_dev *hdev, struct sk_buff *skb)
__fill_isoc_descriptor(urb, skb->len, __fill_isoc_descriptor(urb, skb->len,
le16_to_cpu(data->isoc_tx_ep->wMaxPacketSize)); le16_to_cpu(data->isoc_tx_ep->wMaxPacketSize));
skb->dev = (void *) hdev; skb->dev = (void *)hdev;
return urb; return urb;
} }
...@@ -984,6 +983,7 @@ static void btusb_work(struct work_struct *work) ...@@ -984,6 +983,7 @@ static void btusb_work(struct work_struct *work)
if (hdev->voice_setting & 0x0020) { if (hdev->voice_setting & 0x0020) {
static const int alts[3] = { 2, 4, 5 }; static const int alts[3] = { 2, 4, 5 };
new_alts = alts[data->sco_num - 1]; new_alts = alts[data->sco_num - 1];
} else { } else {
new_alts = data->sco_num; new_alts = data->sco_num;
...@@ -1056,7 +1056,7 @@ static int btusb_setup_csr(struct hci_dev *hdev) ...@@ -1056,7 +1056,7 @@ static int btusb_setup_csr(struct hci_dev *hdev)
return -PTR_ERR(skb); return -PTR_ERR(skb);
} }
rp = (struct hci_rp_read_local_version *) skb->data; rp = (struct hci_rp_read_local_version *)skb->data;
if (!rp->status) { if (!rp->status) {
if (le16_to_cpu(rp->manufacturer) != 10) { if (le16_to_cpu(rp->manufacturer) != 10) {
...@@ -1270,7 +1270,7 @@ static int btusb_check_bdaddr_intel(struct hci_dev *hdev) ...@@ -1270,7 +1270,7 @@ static int btusb_check_bdaddr_intel(struct hci_dev *hdev)
return -EIO; return -EIO;
} }
rp = (struct hci_rp_read_bd_addr *) skb->data; rp = (struct hci_rp_read_bd_addr *)skb->data;
if (rp->status) { if (rp->status) {
BT_ERR("%s Intel device address result failed (%02x)", BT_ERR("%s Intel device address result failed (%02x)",
hdev->name, rp->status); hdev->name, rp->status);
...@@ -1400,6 +1400,7 @@ static int btusb_setup_intel(struct hci_dev *hdev) ...@@ -1400,6 +1400,7 @@ static int btusb_setup_intel(struct hci_dev *hdev)
if (skb->data[0]) { if (skb->data[0]) {
u8 evt_status = skb->data[0]; u8 evt_status = skb->data[0];
BT_ERR("%s enable Intel manufacturer mode event failed (%02x)", BT_ERR("%s enable Intel manufacturer mode event failed (%02x)",
hdev->name, evt_status); hdev->name, evt_status);
kfree_skb(skb); kfree_skb(skb);
...@@ -1596,7 +1597,7 @@ static int btusb_setup_bcm_patchram(struct hci_dev *hdev) ...@@ -1596,7 +1597,7 @@ static int btusb_setup_bcm_patchram(struct hci_dev *hdev)
goto done; goto done;
} }
ver = (struct hci_rp_read_local_version *) skb->data; ver = (struct hci_rp_read_local_version *)skb->data;
BT_INFO("%s: BCM: patching hci_ver=%02x hci_rev=%04x lmp_ver=%02x " BT_INFO("%s: BCM: patching hci_ver=%02x hci_rev=%04x lmp_ver=%02x "
"lmp_subver=%04x", hdev->name, ver->hci_ver, ver->hci_rev, "lmp_subver=%04x", hdev->name, ver->hci_ver, ver->hci_rev,
ver->lmp_ver, ver->lmp_subver); ver->lmp_ver, ver->lmp_subver);
...@@ -1619,7 +1620,7 @@ static int btusb_setup_bcm_patchram(struct hci_dev *hdev) ...@@ -1619,7 +1620,7 @@ static int btusb_setup_bcm_patchram(struct hci_dev *hdev)
fw_size = fw->size; fw_size = fw->size;
while (fw_size >= sizeof(*cmd)) { while (fw_size >= sizeof(*cmd)) {
cmd = (struct hci_command_hdr *) fw_ptr; cmd = (struct hci_command_hdr *)fw_ptr;
fw_ptr += sizeof(*cmd); fw_ptr += sizeof(*cmd);
fw_size -= sizeof(*cmd); fw_size -= sizeof(*cmd);
...@@ -1678,7 +1679,7 @@ static int btusb_setup_bcm_patchram(struct hci_dev *hdev) ...@@ -1678,7 +1679,7 @@ static int btusb_setup_bcm_patchram(struct hci_dev *hdev)
goto done; goto done;
} }
ver = (struct hci_rp_read_local_version *) skb->data; ver = (struct hci_rp_read_local_version *)skb->data;
BT_INFO("%s: BCM: firmware hci_ver=%02x hci_rev=%04x lmp_ver=%02x " BT_INFO("%s: BCM: firmware hci_ver=%02x hci_rev=%04x lmp_ver=%02x "
"lmp_subver=%04x", hdev->name, ver->hci_ver, ver->hci_rev, "lmp_subver=%04x", hdev->name, ver->hci_ver, ver->hci_rev,
ver->lmp_ver, ver->lmp_subver); ver->lmp_ver, ver->lmp_subver);
...@@ -1702,7 +1703,7 @@ static int btusb_setup_bcm_patchram(struct hci_dev *hdev) ...@@ -1702,7 +1703,7 @@ static int btusb_setup_bcm_patchram(struct hci_dev *hdev)
goto done; goto done;
} }
bda = (struct hci_rp_read_bd_addr *) skb->data; bda = (struct hci_rp_read_bd_addr *)skb->data;
if (bda->status) { if (bda->status) {
BT_ERR("%s: HCI_OP_READ_BD_ADDR error status (%02x)", BT_ERR("%s: HCI_OP_READ_BD_ADDR error status (%02x)",
hdev->name, bda->status); hdev->name, bda->status);
...@@ -1761,6 +1762,7 @@ static int btusb_probe(struct usb_interface *intf, ...@@ -1761,6 +1762,7 @@ static int btusb_probe(struct usb_interface *intf,
if (!id->driver_info) { if (!id->driver_info) {
const struct usb_device_id *match; const struct usb_device_id *match;
match = usb_match_id(intf, blacklist_table); match = usb_match_id(intf, blacklist_table);
if (match) if (match)
id = match; id = match;
......
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