Commit 56fede86 authored by Rusty Russell's avatar Rusty Russell Committed by Linus Torvalds

[PATCH] check_region elimination

johnpol@2ka.mipt.ru: 18) request_region check, 11-20:
  here is one more trivial check.

  So please test and apply.

  	Evgeniy Polyakov ( s0mbre )
parent fa049cc7
...@@ -2765,15 +2765,13 @@ static int __init hrz_probe (void) { ...@@ -2765,15 +2765,13 @@ static int __init hrz_probe (void) {
u32 * membase = bus_to_virt (pci_resource_start (pci_dev, 1)); u32 * membase = bus_to_virt (pci_resource_start (pci_dev, 1));
u8 irq = pci_dev->irq; u8 irq = pci_dev->irq;
// check IO region /* XXX DEV_LABEL is a guess */
if (check_region (iobase, HRZ_IO_EXTENT)) { if (!request_region (iobase, HRZ_IO_EXTENT, DEV_LABEL))
PRINTD (DBG_WARN, "IO range already in use"); continue;
continue;
}
if (pci_enable_device (pci_dev)) if (pci_enable_device (pci_dev))
continue; continue;
dev = kmalloc (sizeof(hrz_dev), GFP_KERNEL); dev = kmalloc (sizeof(hrz_dev), GFP_KERNEL);
if (!dev) { if (!dev) {
// perhaps we should be nice: deregister all adapters and abort? // perhaps we should be nice: deregister all adapters and abort?
...@@ -2807,9 +2805,6 @@ static int __init hrz_probe (void) { ...@@ -2807,9 +2805,6 @@ static int __init hrz_probe (void) {
dev->atm_dev->dev_data = (void *) dev; dev->atm_dev->dev_data = (void *) dev;
dev->pci_dev = pci_dev; dev->pci_dev = pci_dev;
/* XXX DEV_LABEL is a guess */
request_region (iobase, HRZ_IO_EXTENT, DEV_LABEL);
// enable bus master accesses // enable bus master accesses
pci_set_master (pci_dev); pci_set_master (pci_dev);
...@@ -2901,8 +2896,10 @@ static int __init hrz_probe (void) { ...@@ -2901,8 +2896,10 @@ static int __init hrz_probe (void) {
atm_dev_deregister (dev->atm_dev); atm_dev_deregister (dev->atm_dev);
} /* atm_dev_register */ } /* atm_dev_register */
free_irq (irq, dev); free_irq (irq, dev);
} /* request_irq */ } /* request_irq */
kfree (dev); kfree (dev);
release_region(iobase, HRZ_IO_EXTENT);
} /* kmalloc and while */ } /* kmalloc and while */
return devs; return devs;
} }
......
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