1 --- a/drivers/cbus/retu-wdt.c
2 +++ b/drivers/cbus/retu-wdt.c
3 @@ -52,7 +52,6 @@ static DEFINE_MUTEX(retu_wdt_mutex);
5 /* Current period of watchdog */
6 static unsigned int period_val = RETU_WDT_DEFAULT_TIMER;
7 -static int counter_param = RETU_WDT_MAX_TIMER;
11 @@ -109,56 +108,6 @@ static void retu_wdt_ping_work(struct wo
12 retu_wdt_ping_enable(wdev);
15 -static ssize_t retu_wdt_period_show(struct device *dev,
16 - struct device_attribute *attr, char *buf)
18 - /* Show current max counter */
19 - return sprintf(buf, "%u\n", (u16)period_val);
23 - * Note: This inteface is non-standard and likely to disappear!
24 - * Use /dev/watchdog instead, that's the standard.
26 -static ssize_t retu_wdt_period_store(struct device *dev,
27 - struct device_attribute *attr,
28 - const char *buf, size_t count)
30 - unsigned int new_period;
33 -#ifdef CONFIG_WATCHDOG_NOWAYOUT
34 - retu_wdt_ping_disable(retu_wdt);
37 - if (sscanf(buf, "%u", &new_period) != 1) {
38 - printk(KERN_ALERT "retu_wdt_period_store: Invalid input\n");
42 - ret = retu_modify_counter(new_period);
46 - return strnlen(buf, count);
49 -static ssize_t retu_wdt_counter_show(struct device *dev,
50 - struct device_attribute *attr, char *buf)
54 - /* Show current value in watchdog counter */
55 - counter = retu_read_reg(dev, RETU_REG_WATCHDOG);
57 - /* Only the 5 LSB are important */
58 - return snprintf(buf, PAGE_SIZE, "%u\n", (counter & 0x3F));
61 -static DEVICE_ATTR(period, S_IRUGO | S_IWUSR, retu_wdt_period_show, \
62 - retu_wdt_period_store);
63 -static DEVICE_ATTR(counter, S_IRUGO, retu_wdt_counter_show, NULL);
65 static int retu_wdt_open(struct inode *inode, struct file *file)
67 if (test_and_set_bit(0, &retu_wdt->users))
68 @@ -232,18 +181,6 @@ static long retu_wdt_ioctl(struct file *
72 -/* Start kicking retu watchdog until user space starts doing the kicking */
73 -static int __devinit retu_wdt_ping(void)
75 -#ifdef CONFIG_WATCHDOG_NOWAYOUT
76 - retu_modify_counter(RETU_WDT_MAX_TIMER);
78 - retu_wdt_ping_enable(retu_wdt);
84 static const struct file_operations retu_wdt_fops = {
86 .write = retu_wdt_write,
87 @@ -252,8 +189,6 @@ static const struct file_operations retu
88 .release = retu_wdt_release,
91 -/*----------------------------------------------------------------------------*/
93 static int __init retu_wdt_probe(struct platform_device *pdev)
95 struct retu_wdt_dev *wdev;
96 @@ -265,18 +200,6 @@ static int __init retu_wdt_probe(struct
98 wdev->dev = &pdev->dev;
100 - ret = device_create_file(&pdev->dev, &dev_attr_period);
102 - dev_err(&pdev->dev, "Error creating sysfs period\n");
106 - ret = device_create_file(&pdev->dev, &dev_attr_counter);
108 - dev_err(&pdev->dev, "Error creating sysfs counter\n");
112 platform_set_drvdata(pdev, wdev);
114 wdev->retu_wdt_miscdev.parent = &pdev->dev;
115 @@ -286,38 +209,21 @@ static int __init retu_wdt_probe(struct
117 ret = misc_register(&(wdev->retu_wdt_miscdev));
120 + goto err_free_wdev;
122 INIT_DELAYED_WORK(&wdev->ping_work, retu_wdt_ping_work);
124 - /* passed as module parameter? */
125 - ret = retu_modify_counter(counter_param);
126 - if (ret == -EINVAL) {
127 - ret = retu_modify_counter(RETU_WDT_DEFAULT_TIMER);
128 - dev_dbg(&pdev->dev, "Initializing to default value\n");
131 - /* Kick the watchdog for kernel booting to finish */
132 + /* Kick the watchdog for kernel booting to finish.
133 + * If nowayout is not set, we start the ping work. */
134 +#ifdef CONFIG_WATCHDOG_NOWAYOUT
135 retu_modify_counter(RETU_WDT_MAX_TIMER);
137 - ret = retu_wdt_ping();
139 - dev_err(&pdev->dev, "Failed to ping\n");
143 + retu_wdt_ping_enable(retu_wdt);
149 - misc_deregister(&wdev->retu_wdt_miscdev);
152 - device_remove_file(&pdev->dev, &dev_attr_counter);
155 - device_remove_file(&pdev->dev, &dev_attr_period);
162 @@ -329,8 +235,6 @@ static int __devexit retu_wdt_remove(str
164 wdev = platform_get_drvdata(pdev);
165 misc_deregister(&wdev->retu_wdt_miscdev);
166 - device_remove_file(&pdev->dev, &dev_attr_period);
167 - device_remove_file(&pdev->dev, &dev_attr_counter);
168 cancel_delayed_work_sync(&wdev->ping_work);
171 @@ -356,9 +260,7 @@ static void __exit retu_wdt_exit(void)
173 module_init(retu_wdt_init);
174 module_exit(retu_wdt_exit);
175 -module_param(counter_param, int, 0);
177 MODULE_DESCRIPTION("Retu WatchDog");
178 MODULE_AUTHOR("Amit Kucheria");
179 MODULE_LICENSE("GPL");