Commit 119d3e56 authored by Wim Van Sebroeck's avatar Wim Van Sebroeck

[WATCHDOG] wdt_pci - use pci_request_region

Use pci_request_region instead of request_region for this pci_driver.
Signed-off-by: default avatarWim Van Sebroeck <wim@iguana.be>
parent d7e9791b
...@@ -647,14 +647,15 @@ static int __devinit wdtpci_init_one(struct pci_dev *dev, ...@@ -647,14 +647,15 @@ static int __devinit wdtpci_init_one(struct pci_dev *dev,
goto out_pci; goto out_pci;
} }
irq = dev->irq; if (pci_request_region(dev, 2, "wdt_pci")) {
io = pci_resource_start(dev, 2); printk(KERN_ERR PFX "I/O address 0x%04x already in use\n",
pci_resource_start(dev, 2));
if (request_region(io, 16, "wdt_pci") == NULL) {
printk(KERN_ERR PFX "I/O address 0x%04x already in use\n", io);
goto out_pci; goto out_pci;
} }
irq = dev->irq;
io = pci_resource_start(dev, 2);
if (request_irq(irq, wdtpci_interrupt, IRQF_DISABLED | IRQF_SHARED, if (request_irq(irq, wdtpci_interrupt, IRQF_DISABLED | IRQF_SHARED,
"wdt_pci", &wdtpci_miscdev)) { "wdt_pci", &wdtpci_miscdev)) {
printk(KERN_ERR PFX "IRQ %d is not free\n", irq); printk(KERN_ERR PFX "IRQ %d is not free\n", irq);
...@@ -717,7 +718,7 @@ static int __devinit wdtpci_init_one(struct pci_dev *dev, ...@@ -717,7 +718,7 @@ static int __devinit wdtpci_init_one(struct pci_dev *dev,
out_irq: out_irq:
free_irq(irq, &wdtpci_miscdev); free_irq(irq, &wdtpci_miscdev);
out_reg: out_reg:
release_region(io, 16); pci_release_region(dev, 2);
out_pci: out_pci:
pci_disable_device(dev); pci_disable_device(dev);
goto out; goto out;
...@@ -733,7 +734,7 @@ static void __devexit wdtpci_remove_one(struct pci_dev *pdev) ...@@ -733,7 +734,7 @@ static void __devexit wdtpci_remove_one(struct pci_dev *pdev)
misc_deregister(&temp_miscdev); misc_deregister(&temp_miscdev);
unregister_reboot_notifier(&wdtpci_notifier); unregister_reboot_notifier(&wdtpci_notifier);
free_irq(irq, &wdtpci_miscdev); free_irq(irq, &wdtpci_miscdev);
release_region(io, 16); pci_release_region(pdev, 2);
pci_disable_device(pdev); pci_disable_device(pdev);
dev_count--; dev_count--;
} }
......
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