Commit 591095cb authored by Wim Van Sebroeck's avatar Wim Van Sebroeck

[WATCHDOG] v2.6.4 pcwd_pci-v1.00_20040313-patch

Two small fixes:
* Make cards_found a global variable so that if we remove the
  pci device we can count down.
* If we can't find a correct I/O address for the card, then we
should disable the card again.
parent 9bf35f8c
...@@ -49,7 +49,7 @@ ...@@ -49,7 +49,7 @@
/* Module and version information */ /* Module and version information */
#define WATCHDOG_VERSION "1.00" #define WATCHDOG_VERSION "1.00"
#define WATCHDOG_DATE "09/02/2004" #define WATCHDOG_DATE "13/03/2004"
#define WATCHDOG_DRIVER_NAME "PCI-PC Watchdog" #define WATCHDOG_DRIVER_NAME "PCI-PC Watchdog"
#define WATCHDOG_NAME "pcwd_pci" #define WATCHDOG_NAME "pcwd_pci"
#define PFX WATCHDOG_NAME ": " #define PFX WATCHDOG_NAME ": "
...@@ -82,6 +82,9 @@ ...@@ -82,6 +82,9 @@
#define CMD_READ_WATCHDOG_TIMEOUT 0x18 #define CMD_READ_WATCHDOG_TIMEOUT 0x18
#define CMD_WRITE_WATCHDOG_TIMEOUT 0x19 #define CMD_WRITE_WATCHDOG_TIMEOUT 0x19
/* We can only use 1 card due to the /dev/watchdog restriction */
static int cards_found;
/* internal variables */ /* internal variables */
static int temp_panic; static int temp_panic;
static unsigned long is_active; static unsigned long is_active;
...@@ -505,7 +508,6 @@ static inline void check_temperature_support(void) ...@@ -505,7 +508,6 @@ static inline void check_temperature_support(void)
static int __devinit pcipcwd_card_init(struct pci_dev *pdev, static int __devinit pcipcwd_card_init(struct pci_dev *pdev,
const struct pci_device_id *ent) const struct pci_device_id *ent)
{ {
static int cards_found;
int ret = -EIO; int ret = -EIO;
int got_fw_rev, fw_rev_major, fw_rev_minor; int got_fw_rev, fw_rev_major, fw_rev_minor;
char fw_ver_str[20]; char fw_ver_str[20];
...@@ -527,7 +529,8 @@ static int __devinit pcipcwd_card_init(struct pci_dev *pdev, ...@@ -527,7 +529,8 @@ static int __devinit pcipcwd_card_init(struct pci_dev *pdev,
if (pci_resource_start(pdev, 0) == 0x0000) { if (pci_resource_start(pdev, 0) == 0x0000) {
printk(KERN_ERR PFX "No I/O-Address for card detected\n"); printk(KERN_ERR PFX "No I/O-Address for card detected\n");
return -ENODEV; ret = -ENODEV;
goto err_out_disable_device;
} }
pcipcwd_private.pdev = pdev; pcipcwd_private.pdev = pdev;
...@@ -643,6 +646,7 @@ static void __devexit pcipcwd_card_exit(struct pci_dev *pdev) ...@@ -643,6 +646,7 @@ static void __devexit pcipcwd_card_exit(struct pci_dev *pdev)
unregister_reboot_notifier(&pcipcwd_notifier); unregister_reboot_notifier(&pcipcwd_notifier);
pci_release_regions(pdev); pci_release_regions(pdev);
pci_disable_device(pdev); pci_disable_device(pdev);
cards_found--;
} }
static struct pci_device_id pcipcwd_pci_tbl[] = { static struct pci_device_id pcipcwd_pci_tbl[] = {
......
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