Commit dc42ad2c authored by Marcel Holtmann's avatar Marcel Holtmann

[Bluetooth] Use BT_ERR wherever possible

This patch neatens the code by using BT_ERR and so using the function
name in the macro to save code and rom space.

Patch from Joe Perches <joe@perches.com>
parent 7f9e1ee0
......@@ -226,7 +226,7 @@ static int bluecard_write(unsigned int iobase, unsigned int offset, __u8 *buf, i
static void bluecard_write_wakeup(bluecard_info_t *info)
{
if (!info) {
printk(KERN_WARNING "bluecard_cs: Call of write_wakeup for unknown device.\n");
BT_ERR("Unknown device");
return;
}
......@@ -379,7 +379,7 @@ static void bluecard_receive(bluecard_info_t *info, unsigned int offset)
int i, len;
if (!info) {
printk(KERN_WARNING "bluecard_cs: Call of receive for unknown device.\n");
BT_ERR("Unknown device");
return;
}
......@@ -397,7 +397,7 @@ static void bluecard_receive(bluecard_info_t *info, unsigned int offset)
info->rx_state = RECV_WAIT_PACKET_TYPE;
info->rx_count = 0;
if (!(info->rx_skb = bt_skb_alloc(HCI_MAX_FRAME_SIZE, GFP_ATOMIC))) {
printk(KERN_WARNING "bluecard_cs: Can't allocate mem for new packet.\n");
BT_ERR("Can't allocate mem for new packet");
return;
}
}
......@@ -439,7 +439,7 @@ static void bluecard_receive(bluecard_info_t *info, unsigned int offset)
default:
/* unknown packet */
printk(KERN_WARNING "bluecard_cs: Unknown HCI packet with type 0x%02x received.\n", info->rx_skb->pkt_type);
BT_ERR("Unknown HCI packet with type 0x%02x received", info->rx_skb->pkt_type);
info->hdev->stat.err_rx++;
kfree_skb(info->rx_skb);
......@@ -506,7 +506,7 @@ static irqreturn_t bluecard_interrupt(int irq, void *dev_inst, struct pt_regs *r
unsigned char reg;
if (!info) {
printk(KERN_WARNING "bluecard_cs: Call of irq %d for unknown device.\n", irq);
BT_ERR("Call of irq %d for unknown device", irq);
return IRQ_NONE;
}
......@@ -574,7 +574,7 @@ static int bluecard_hci_set_baud_rate(struct hci_dev *hdev, int baud)
unsigned char cmd[] = { HCI_COMMAND_PKT, 0x09, 0xfc, 0x01, 0x03 };
if (!(skb = bt_skb_alloc(HCI_MAX_FRAME_SIZE, GFP_ATOMIC))) {
printk(KERN_WARNING "bluecard_cs: Can't allocate mem for new packet.\n");
BT_ERR("Can't allocate mem for new packet");
return -1;
}
......@@ -664,7 +664,7 @@ static int bluecard_hci_send_frame(struct sk_buff *skb)
struct hci_dev *hdev = (struct hci_dev *)(skb->dev);
if (!hdev) {
printk(KERN_WARNING "bluecard_cs: Frame for unknown HCI device (hdev=NULL).");
BT_ERR("Frame for unknown HCI device (hdev=NULL)");
return -ENODEV;
}
......@@ -780,7 +780,7 @@ int bluecard_open(bluecard_info_t *info)
/* Initialize and register HCI device */
hdev = hci_alloc_dev();
if (!hdev) {
printk(KERN_WARNING "bluecard_cs: Can't allocate HCI device.\n");
BT_ERR("Can't allocate HCI device");
return -ENOMEM;
}
......@@ -799,7 +799,7 @@ int bluecard_open(bluecard_info_t *info)
hdev->owner = THIS_MODULE;
if (hci_register_dev(hdev) < 0) {
printk(KERN_WARNING "bluecard_cs: Can't register HCI device.\n");
BT_ERR("Can't register HCI device");
hci_free_dev(hdev);
return -ENODEV;
}
......@@ -825,7 +825,7 @@ int bluecard_close(bluecard_info_t *info)
outb(0x80, iobase + 0x30);
if (hci_unregister_dev(hdev) < 0)
printk(KERN_WARNING "bluecard_cs: Can't unregister HCI device %s.\n", hdev->name);
BT_ERR("Can't unregister HCI device %s", hdev->name);
hci_free_dev(hdev);
......
......@@ -195,7 +195,7 @@ static void bt3c_write_wakeup(bt3c_info_t *info, int from)
unsigned long flags;
if (!info) {
printk(KERN_WARNING "bt3c_cs: Call of write_wakeup for unknown device.\n");
BT_ERR("Unknown device");
return;
}
......@@ -222,7 +222,7 @@ static void bt3c_write_wakeup(bt3c_info_t *info, int from)
len = bt3c_write(iobase, 256, skb->data, skb->len);
if (len != skb->len) {
printk(KERN_WARNING "bt3c_cs: very strange\n");
BT_ERR("Very strange");
}
kfree_skb(skb);
......@@ -241,7 +241,7 @@ static void bt3c_receive(bt3c_info_t *info)
int size = 0, avail;
if (!info) {
printk(KERN_WARNING "bt3c_cs: Call of receive for unknown device.\n");
BT_ERR("Unknown device");
return;
}
......@@ -260,7 +260,7 @@ static void bt3c_receive(bt3c_info_t *info)
info->rx_state = RECV_WAIT_PACKET_TYPE;
info->rx_count = 0;
if (!(info->rx_skb = bt_skb_alloc(HCI_MAX_FRAME_SIZE, GFP_ATOMIC))) {
printk(KERN_WARNING "bt3c_cs: Can't allocate mem for new packet.\n");
BT_ERR("Can't allocate mem for new packet");
return;
}
}
......@@ -292,7 +292,7 @@ static void bt3c_receive(bt3c_info_t *info)
default:
/* Unknown packet */
printk(KERN_WARNING "bt3c_cs: Unknown HCI packet with type 0x%02x received.\n", info->rx_skb->pkt_type);
BT_ERR("Unknown HCI packet with type 0x%02x received", info->rx_skb->pkt_type);
info->hdev->stat.err_rx++;
clear_bit(HCI_RUNNING, &(info->hdev->flags));
......@@ -362,7 +362,7 @@ static irqreturn_t bt3c_interrupt(int irq, void *dev_inst, struct pt_regs *regs)
int iir;
if (!info) {
printk(KERN_WARNING "bt3c_cs: Call of irq %d for unknown device.\n", irq);
BT_ERR("Call of irq %d for unknown device", irq);
return IRQ_NONE;
}
......@@ -375,16 +375,16 @@ static irqreturn_t bt3c_interrupt(int irq, void *dev_inst, struct pt_regs *regs)
int stat = bt3c_read(iobase, 0x7001);
if ((stat & 0xff) == 0x7f) {
printk(KERN_WARNING "bt3c_cs: STRANGE stat=%04x\n", stat);
BT_ERR("Very strange (stat=0x%04x)", stat);
} else if ((stat & 0xff) != 0xff) {
if (stat & 0x0020) {
int stat = bt3c_read(iobase, 0x7002) & 0x10;
printk(KERN_WARNING "bt3c_cs: antena %s\n", stat ? "OUT" : "IN");
BT_ERR("Antenna %s", stat ? "out" : "in");
}
if (stat & 0x0001)
bt3c_receive(info);
if (stat & 0x0002) {
//printk("bt3c_cs: ACK %04x\n", stat);
//BT_ERR("Ack (stat=0x%04x)", stat);
clear_bit(XMIT_SENDING, &(info->tx_state));
bt3c_write_wakeup(info, 1);
}
......@@ -441,7 +441,7 @@ static int bt3c_hci_send_frame(struct sk_buff *skb)
struct hci_dev *hdev = (struct hci_dev *)(skb->dev);
if (!hdev) {
printk(KERN_WARNING "bt3c_cs: Frame for unknown HCI device (hdev=NULL).");
BT_ERR("Frame for unknown HCI device (hdev=NULL)");
return -ENODEV;
}
......@@ -499,7 +499,7 @@ static int bt3c_firmware_load(bt3c_info_t *info)
err = call_usermodehelper(FW_LOADER, argv, envp, 1);
if (err)
printk(KERN_WARNING "bt3c_cs: Failed to run \"%s pccard %s\" (errno=%d).\n", FW_LOADER, dev, err);
BT_ERR("Failed to run \"%s pccard %s\" (errno=%d)", FW_LOADER, dev, err);
return err;
}
......@@ -536,7 +536,7 @@ int bt3c_open(bt3c_info_t *info)
/* Initialize and register HCI device */
hdev = hci_alloc_dev();
if (!hdev) {
printk(KERN_WARNING "bt3c_cs: Can't allocate HCI device.\n");
BT_ERR("Can't allocate HCI device");
return -ENOMEM;
}
......@@ -555,7 +555,7 @@ int bt3c_open(bt3c_info_t *info)
hdev->owner = THIS_MODULE;
if (hci_register_dev(hdev) < 0) {
printk(KERN_WARNING "bt3c_cs: Can't register HCI device.\n");
BT_ERR("Can't register HCI device");
hci_free_dev(hdev);
return -ENODEV;
}
......@@ -571,7 +571,7 @@ int bt3c_close(bt3c_info_t *info)
bt3c_hci_close(hdev);
if (hci_unregister_dev(hdev) < 0)
printk(KERN_WARNING "bt3c_cs: Can't unregister HCI device %s.\n", hdev->name);
BT_ERR("Can't unregister HCI device %s", hdev->name);
hci_free_dev(hdev);
......@@ -769,7 +769,7 @@ void bt3c_config(dev_link_t *link)
found_port:
if (i != CS_SUCCESS) {
printk(KERN_NOTICE "bt3c_cs: No usable port range found. Giving up.\n");
BT_ERR("No usable port range found");
cs_error(link->handle, RequestIO, i);
goto failed;
}
......
......@@ -148,7 +148,7 @@ static int btuart_write(unsigned int iobase, int fifo_size, __u8 *buf, int len)
static void btuart_write_wakeup(btuart_info_t *info)
{
if (!info) {
printk(KERN_WARNING "btuart_cs: Call of write_wakeup for unknown device.\n");
BT_ERR("Unknown device");
return;
}
......@@ -195,7 +195,7 @@ static void btuart_receive(btuart_info_t *info)
int boguscount = 0;
if (!info) {
printk(KERN_WARNING "btuart_cs: Call of receive for unknown device.\n");
BT_ERR("Unknown device");
return;
}
......@@ -209,7 +209,7 @@ static void btuart_receive(btuart_info_t *info)
info->rx_state = RECV_WAIT_PACKET_TYPE;
info->rx_count = 0;
if (!(info->rx_skb = bt_skb_alloc(HCI_MAX_FRAME_SIZE, GFP_ATOMIC))) {
printk(KERN_WARNING "btuart_cs: Can't allocate mem for new packet.\n");
BT_ERR("Can't allocate mem for new packet");
return;
}
}
......@@ -238,7 +238,7 @@ static void btuart_receive(btuart_info_t *info)
default:
/* Unknown packet */
printk(KERN_WARNING "btuart_cs: Unknown HCI packet with type 0x%02x received.\n", info->rx_skb->pkt_type);
BT_ERR("Unknown HCI packet with type 0x%02x received", info->rx_skb->pkt_type);
info->hdev->stat.err_rx++;
clear_bit(HCI_RUNNING, &(info->hdev->flags));
......@@ -309,7 +309,7 @@ static irqreturn_t btuart_interrupt(int irq, void *dev_inst, struct pt_regs *reg
int iir, lsr;
if (!info) {
printk(KERN_WARNING "btuart_cs: Call of irq %d for unknown device.\n", irq);
BT_ERR("Call of irq %d for unknown device", irq);
return IRQ_NONE;
}
......@@ -325,7 +325,7 @@ static irqreturn_t btuart_interrupt(int irq, void *dev_inst, struct pt_regs *reg
switch (iir) {
case UART_IIR_RLSI:
printk(KERN_NOTICE "btuart_cs: RLSI\n");
BT_ERR("RLSI");
break;
case UART_IIR_RDI:
/* Receive interrupt */
......@@ -338,7 +338,7 @@ static irqreturn_t btuart_interrupt(int irq, void *dev_inst, struct pt_regs *reg
}
break;
default:
printk(KERN_NOTICE "btuart_cs: Unhandled IIR=%#x\n", iir);
BT_ERR("Unhandled IIR=%#x", iir);
break;
}
......@@ -365,7 +365,7 @@ static void btuart_change_speed(btuart_info_t *info, unsigned int speed)
int divisor;
if (!info) {
printk(KERN_WARNING "btuart_cs: Call of change speed for unknown device.\n");
BT_ERR("Unknown device");
return;
}
......@@ -447,7 +447,7 @@ static int btuart_hci_send_frame(struct sk_buff *skb)
struct hci_dev *hdev = (struct hci_dev *)(skb->dev);
if (!hdev) {
printk(KERN_WARNING "btuart_cs: Frame for unknown HCI device (hdev=NULL).");
BT_ERR("Frame for unknown HCI device (hdev=NULL)");
return -ENODEV;
}
......@@ -531,7 +531,7 @@ int btuart_open(btuart_info_t *info)
/* Initialize and register HCI device */
hdev = hci_alloc_dev();
if (!hdev) {
printk(KERN_WARNING "btuart_cs: Can't allocate HCI device.\n");
BT_ERR("Can't allocate HCI device");
return -ENOMEM;
}
......@@ -550,7 +550,7 @@ int btuart_open(btuart_info_t *info)
hdev->owner = THIS_MODULE;
if (hci_register_dev(hdev) < 0) {
printk(KERN_WARNING "btuart_cs: Can't register HCI device.\n");
BT_ERR("Can't register HCI device");
hci_free_dev(hdev);
return -ENODEV;
}
......@@ -578,7 +578,7 @@ int btuart_close(btuart_info_t *info)
spin_unlock_irqrestore(&(info->lock), flags);
if (hci_unregister_dev(hdev) < 0)
printk(KERN_WARNING "btuart_cs: Can't unregister HCI device %s.\n", hdev->name);
BT_ERR("Can't unregister HCI device %s", hdev->name);
hci_free_dev(hdev);
......@@ -777,7 +777,7 @@ void btuart_config(dev_link_t *link)
found_port:
if (i != CS_SUCCESS) {
printk(KERN_NOTICE "btuart_cs: No usable port range found. Giving up.\n");
BT_ERR("No usable port range found");
cs_error(link->handle, RequestIO, i);
goto failed;
}
......
......@@ -150,7 +150,7 @@ static int dtl1_write(unsigned int iobase, int fifo_size, __u8 *buf, int len)
static void dtl1_write_wakeup(dtl1_info_t *info)
{
if (!info) {
printk(KERN_WARNING "dtl1_cs: Call of write_wakeup for unknown device.\n");
BT_ERR("Unknown device");
return;
}
......@@ -201,9 +201,9 @@ static void dtl1_control(dtl1_info_t *info, struct sk_buff *skb)
u8 flowmask = *(u8 *)skb->data;
int i;
printk(KERN_INFO "dtl1_cs: Nokia control data = ");
printk(KERN_INFO "Bluetooth: Nokia control data =");
for (i = 0; i < skb->len; i++) {
printk("%02x ", skb->data[i]);
printk(" %02x", skb->data[i]);
}
printk("\n");
......@@ -226,7 +226,7 @@ static void dtl1_receive(dtl1_info_t *info)
int boguscount = 0;
if (!info) {
printk(KERN_WARNING "dtl1_cs: Call of receive for unknown device.\n");
BT_ERR("Unknown device");
return;
}
......@@ -238,7 +238,7 @@ static void dtl1_receive(dtl1_info_t *info)
/* Allocate packet */
if (info->rx_skb == NULL)
if (!(info->rx_skb = bt_skb_alloc(HCI_MAX_FRAME_SIZE, GFP_ATOMIC))) {
printk(KERN_WARNING "dtl1_cs: Can't allocate mem for new packet.\n");
BT_ERR("Can't allocate mem for new packet");
info->rx_state = RECV_WAIT_NSH;
info->rx_count = NSHL;
return;
......@@ -283,7 +283,7 @@ static void dtl1_receive(dtl1_info_t *info)
break;
default:
/* unknown packet */
printk(KERN_WARNING "dtl1_cs: Unknown HCI packet with type 0x%02x received.\n", info->rx_skb->pkt_type);
BT_ERR("Unknown HCI packet with type 0x%02x received", info->rx_skb->pkt_type);
kfree_skb(info->rx_skb);
break;
}
......@@ -313,7 +313,7 @@ static irqreturn_t dtl1_interrupt(int irq, void *dev_inst, struct pt_regs *regs)
int iir, lsr;
if (!info) {
printk(KERN_WARNING "dtl1_cs: Call of irq %d for unknown device.\n", irq);
BT_ERR("Call of irq %d for unknown device", irq);
return IRQ_NONE;
}
......@@ -329,7 +329,7 @@ static irqreturn_t dtl1_interrupt(int irq, void *dev_inst, struct pt_regs *regs)
switch (iir) {
case UART_IIR_RLSI:
printk(KERN_NOTICE "dtl1_cs: RLSI\n");
BT_ERR("RLSI");
break;
case UART_IIR_RDI:
/* Receive interrupt */
......@@ -342,7 +342,7 @@ static irqreturn_t dtl1_interrupt(int irq, void *dev_inst, struct pt_regs *regs)
}
break;
default:
printk(KERN_NOTICE "dtl1_cs: Unhandled IIR=%#x\n", iir);
BT_ERR("Unhandled IIR=%#x", iir);
break;
}
......@@ -410,7 +410,7 @@ static int dtl1_hci_send_frame(struct sk_buff *skb)
nsh_t nsh;
if (!hdev) {
printk(KERN_WARNING "dtl1_cs: Frame for unknown HCI device (hdev=NULL).");
BT_ERR("Frame for unknown HCI device (hdev=NULL)");
return -ENODEV;
}
......@@ -510,7 +510,7 @@ int dtl1_open(dtl1_info_t *info)
/* Initialize and register HCI device */
hdev = hci_alloc_dev();
if (!hdev) {
printk(KERN_WARNING "dtl1_cs: Can't allocate HCI device.\n");
BT_ERR("Can't allocate HCI device");
return -ENOMEM;
}
......@@ -529,7 +529,7 @@ int dtl1_open(dtl1_info_t *info)
hdev->owner = THIS_MODULE;
if (hci_register_dev(hdev) < 0) {
printk(KERN_WARNING "dtl1_cs: Can't register HCI device.\n");
BT_ERR("Can't register HCI device");
hci_free_dev(hdev);
return -ENODEV;
}
......@@ -557,7 +557,7 @@ int dtl1_close(dtl1_info_t *info)
spin_unlock_irqrestore(&(info->lock), flags);
if (hci_unregister_dev(hdev) < 0)
printk(KERN_WARNING "dtl1_cs: Can't unregister HCI device %s.\n", hdev->name);
BT_ERR("Can't unregister HCI device %s", hdev->name);
hci_free_dev(hdev);
......
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