git://ftp.safe.ca
/
safe
/
jmp
/
linux-2.6
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
mempolicy: ERR_PTR dereference in mpol_shared_policy_init()
[safe/jmp/linux-2.6]
/
drivers
/
bluetooth
/
btuart_cs.c
diff --git
a/drivers/bluetooth/btuart_cs.c
b/drivers/bluetooth/btuart_cs.c
index
1718312
..
4ed7288
100644
(file)
--- a/
drivers/bluetooth/btuart_cs.c
+++ b/
drivers/bluetooth/btuart_cs.c
@@
-67,7
+67,6
@@
MODULE_LICENSE("GPL");
typedef struct btuart_info_t {
struct pcmcia_device *p_dev;
typedef struct btuart_info_t {
struct pcmcia_device *p_dev;
- dev_node_t node;
struct hci_dev *hdev;
struct hci_dev *hdev;
@@
-293,8
+292,11
@@
static irqreturn_t btuart_interrupt(int irq, void *dev_inst)
unsigned int iobase;
int boguscount = 0;
int iir, lsr;
unsigned int iobase;
int boguscount = 0;
int iir, lsr;
+ irqreturn_t r = IRQ_NONE;
- BUG_ON(!info->hdev);
+ if (!info || !info->hdev)
+ /* our irq handler is shared */
+ return IRQ_NONE;
iobase = info->p_dev->io.BasePort1;
iobase = info->p_dev->io.BasePort1;
@@
-302,6
+304,7
@@
static irqreturn_t btuart_interrupt(int irq, void *dev_inst)
iir = inb(iobase + UART_IIR) & UART_IIR_ID;
while (iir) {
iir = inb(iobase + UART_IIR) & UART_IIR_ID;
while (iir) {
+ r = IRQ_HANDLED;
/* Clear interrupt */
lsr = inb(iobase + UART_LSR);
/* Clear interrupt */
lsr = inb(iobase + UART_LSR);
@@
-335,7
+338,7
@@
static irqreturn_t btuart_interrupt(int irq, void *dev_inst)
spin_unlock(&(info->lock));
spin_unlock(&(info->lock));
- return
IRQ_HANDLED
;
+ return
r
;
}
}
@@
-496,7
+499,7
@@
static int btuart_open(btuart_info_t *info)
info->hdev = hdev;
info->hdev = hdev;
- hdev->
type
= HCI_PCCARD;
+ hdev->
bus
= HCI_PCCARD;
hdev->driver_data = info;
SET_HCIDEV_DEV(hdev, &info->p_dev->dev);
hdev->driver_data = info;
SET_HCIDEV_DEV(hdev, &info->p_dev->dev);
@@
-586,11
+589,6
@@
static int btuart_probe(struct pcmcia_device *link)
link->io.Attributes1 = IO_DATA_PATH_WIDTH_8;
link->io.NumPorts1 = 8;
link->io.Attributes1 = IO_DATA_PATH_WIDTH_8;
link->io.NumPorts1 = 8;
- link->irq.Attributes = IRQ_TYPE_EXCLUSIVE | IRQ_HANDLE_PRESENT;
- link->irq.IRQInfo1 = IRQ_LEVEL_ID;
-
- link->irq.Handler = btuart_interrupt;
- link->irq.Instance = info;
link->conf.Attributes = CONF_ENABLE_IRQ;
link->conf.IntType = INT_MEMORY_AND_IO;
link->conf.Attributes = CONF_ENABLE_IRQ;
link->conf.IntType = INT_MEMORY_AND_IO;
@@
-667,28
+665,20
@@
static int btuart_config(struct pcmcia_device *link)
goto found_port;
BT_ERR("No usable port range found");
goto found_port;
BT_ERR("No usable port range found");
- cs_error(link, RequestIO, -ENODEV);
goto failed;
found_port:
goto failed;
found_port:
- i = pcmcia_request_irq(link, &link->irq);
- if (i != CS_SUCCESS) {
- cs_error(link, RequestIRQ, i);
- link->irq.AssignedIRQ = 0;
- }
+ i = pcmcia_request_irq(link, btuart_interrupt);
+ if (i != 0)
+ goto failed;
i = pcmcia_request_configuration(link, &link->conf);
i = pcmcia_request_configuration(link, &link->conf);
- if (i != CS_SUCCESS) {
- cs_error(link, RequestConfiguration, i);
+ if (i != 0)
goto failed;
goto failed;
- }
if (btuart_open(info) != 0)
goto failed;
if (btuart_open(info) != 0)
goto failed;
- strcpy(info->node.dev_name, info->hdev->name);
- link->dev_node = &info->node;
-
return 0;
failed:
return 0;
failed: