Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 811f9991 authored by Naveen Gupta's avatar Naveen Gupta Committed by Wim Van Sebroeck
Browse files

[WATCHDOG] i6300esb.c-pci_dev_put+nowayout-patch



One pci_dev_put was misused (there was one case without putting
the device).
Changed nowayout according to other drivers.

Signed-off-by: default avatarJiri Slaby <xslaby@fi.muni.cz>
Signed-off-by: default avatarNaveen Gupta <ngupta@google.com>
Signed-off-by: default avatarWim Van Sebroeck <wim@iguana.be>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
parent ce2f50b4
Loading
Loading
Loading
Loading
+6 −9
Original line number Original line Diff line number Diff line
@@ -69,11 +69,7 @@ static int heartbeat = WATCHDOG_HEARTBEAT; /* in seconds */
module_param(heartbeat, int, 0);
module_param(heartbeat, int, 0);
MODULE_PARM_DESC(heartbeat, "Watchdog heartbeat in seconds. (1<heartbeat<2046, default=" __MODULE_STRING(WATCHDOG_HEARTBEAT) ")");
MODULE_PARM_DESC(heartbeat, "Watchdog heartbeat in seconds. (1<heartbeat<2046, default=" __MODULE_STRING(WATCHDOG_HEARTBEAT) ")");


#ifdef CONFIG_WATCHDOG_NOWAYOUT
static int nowayout = WATCHDOG_NOWAYOUT;
static int nowayout = 1;
#else
static int nowayout = 0;
#endif
module_param(nowayout, int, 0);
module_param(nowayout, int, 0);
MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)");
MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)");


@@ -368,16 +364,17 @@ static unsigned char __init esb_getdevice (void)
         *      Find the PCI device
         *      Find the PCI device
         */
         */


        for_each_pci_dev(dev)
        for_each_pci_dev(dev) {
                if (pci_match_device(esb_pci_tbl, dev)) {
                if (pci_match_device(esb_pci_tbl, dev)) {
                        esb_pci = dev;
                        esb_pci = dev;
                        break;
                        break;
                }
                }
	}


        if (esb_pci) {
        if (esb_pci) {
        	if (pci_enable_device(esb_pci)) {
        	if (pci_enable_device(esb_pci)) {
			printk (KERN_ERR PFX "failed to enable device\n");
			printk (KERN_ERR PFX "failed to enable device\n");
			goto out;
			goto err_devput;
		}
		}


		if (pci_request_region(esb_pci, 0, ESB_MODULE_NAME)) {
		if (pci_request_region(esb_pci, 0, ESB_MODULE_NAME)) {
@@ -429,9 +426,9 @@ static unsigned char __init esb_getdevice (void)
		pci_release_region(esb_pci, 0);
		pci_release_region(esb_pci, 0);
err_disable:
err_disable:
		pci_disable_device(esb_pci);
		pci_disable_device(esb_pci);
err_devput:
		pci_dev_put(esb_pci);
		pci_dev_put(esb_pci);
	}
	}
out:
	return 0;
	return 0;
}
}


@@ -481,8 +478,8 @@ static int __init watchdog_init (void)
	pci_release_region(esb_pci, 0);
	pci_release_region(esb_pci, 0);
/* err_disable: */
/* err_disable: */
	pci_disable_device(esb_pci);
	pci_disable_device(esb_pci);
/* err_devput: */
	pci_dev_put(esb_pci);
	pci_dev_put(esb_pci);
/* out: */
        return ret;
        return ret;
}
}