[WATCHDOG] iTCO_wdt: clean up probe(), modify err msg
authorNaga Chumbalkar <nagananda.chumbalkar@hp.com>
Mon, 8 Feb 2010 23:42:02 +0000 (00:42 +0100)
committerWim Van Sebroeck <wim@iguana.be>
Sat, 6 Mar 2010 15:12:55 +0000 (15:12 +0000)
It's possible that the platform is not allowing reboot via TCO timer
expiration.

Also, differentiate between not finding a chipset that has TCO, and the case
where TCO is present but the driver fails to initialize for some reason.

Signed-off-by: Naga Chumbalkar <nagananda.chumbalkar@hp.com>
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
drivers/watchdog/iTCO_wdt.c

index 4bdb7f1a90772d780037bf2456e3656c1ad6a1ae..a619b9b74991ae4c4ef072eb818cdd0df723ba5e 100644 (file)
@@ -698,7 +698,7 @@ static int __devinit iTCO_wdt_init(struct pci_dev *pdev,
        if (iTCO_wdt_private.iTCO_version == 2) {
                pci_read_config_dword(pdev, 0xf0, &base_address);
                if ((base_address & 1) == 0) {
-                       printk(KERN_ERR PFX "RCBA is disabled by harddware\n");
+                       printk(KERN_ERR PFX "RCBA is disabled by hardware\n");
                        ret = -ENODEV;
                        goto out;
                }
@@ -708,8 +708,8 @@ static int __devinit iTCO_wdt_init(struct pci_dev *pdev,
 
        /* Check chipset's NO_REBOOT bit */
        if (iTCO_wdt_unset_NO_REBOOT_bit() && iTCO_vendor_check_noreboot_on()) {
-               printk(KERN_ERR PFX "failed to reset NO_REBOOT flag, "
-                                       "reboot disabled by hardware\n");
+               printk(KERN_INFO PFX "unable to reset NO_REBOOT flag, "
+                                       "platform may have disabled it\n");
                ret = -ENODEV;  /* Cannot reset NO_REBOOT bit */
                goto out_unmap;
        }
@@ -805,6 +805,7 @@ static void __devexit iTCO_wdt_cleanup(void)
 
 static int __devinit iTCO_wdt_probe(struct platform_device *dev)
 {
+       int ret = -ENODEV;
        int found = 0;
        struct pci_dev *pdev = NULL;
        const struct pci_device_id *ent;
@@ -814,19 +815,17 @@ static int __devinit iTCO_wdt_probe(struct platform_device *dev)
        for_each_pci_dev(pdev) {
                ent = pci_match_id(iTCO_wdt_pci_tbl, pdev);
                if (ent) {
-                       if (!(iTCO_wdt_init(pdev, ent, dev))) {
-                               found++;
+                       found++;
+                       ret = iTCO_wdt_init(pdev, ent, dev);
+                       if (!ret)
                                break;
-                       }
                }
        }
 
-       if (!found) {
+       if (!found)
                printk(KERN_INFO PFX "No card detected\n");
-               return -ENODEV;
-       }
 
-       return 0;
+       return ret;
 }
 
 static int __devexit iTCO_wdt_remove(struct platform_device *dev)