Skip to content

Commit

Permalink
Merge master.kernel.org:/pub/scm/linux/kernel/git/wim/linux-2.6-watchdog
Browse files Browse the repository at this point in the history
* master.kernel.org:/pub/scm/linux/kernel/git/wim/linux-2.6-watchdog:
  [WATCHDOG] pcwd_usb.c generic HID include file
  [WATCHDOG] watchdog miscdevice patch
  [WATCHDOG] rm9k_wdt: fix interrupt handler arguments
  [WATCHDOG] rm9k_wdt: fix compilation
  • Loading branch information
Linus Torvalds committed Dec 13, 2006
2 parents c436688 + a57bf8a commit d940505
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 31 deletions.
6 changes: 3 additions & 3 deletions drivers/char/watchdog/at91rm9200_wdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -203,9 +203,9 @@ static int __init at91wdt_probe(struct platform_device *pdev)
{
int res;

if (at91wdt_miscdev.dev)
if (at91wdt_miscdev.parent)
return -EBUSY;
at91wdt_miscdev.dev = &pdev->dev;
at91wdt_miscdev.parent = &pdev->dev;

res = misc_register(&at91wdt_miscdev);
if (res)
Expand All @@ -221,7 +221,7 @@ static int __exit at91wdt_remove(struct platform_device *pdev)

res = misc_deregister(&at91wdt_miscdev);
if (!res)
at91wdt_miscdev.dev = NULL;
at91wdt_miscdev.parent = NULL;

return res;
}
Expand Down
2 changes: 1 addition & 1 deletion drivers/char/watchdog/mpcore_wdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ static int __devinit mpcore_wdt_probe(struct platform_device *dev)
goto err_free;
}

mpcore_wdt_miscdev.dev = &dev->dev;
mpcore_wdt_miscdev.parent = &dev->dev;
ret = misc_register(&mpcore_wdt_miscdev);
if (ret) {
dev_printk(KERN_ERR, _dev, "cannot register miscdev on minor=%d (err=%d)\n",
Expand Down
2 changes: 1 addition & 1 deletion drivers/char/watchdog/omap_wdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ static int __init omap_wdt_probe(struct platform_device *pdev)
omap_wdt_disable();
omap_wdt_adjust_timeout(timer_margin);

omap_wdt_miscdev.dev = &pdev->dev;
omap_wdt_miscdev.parent = &pdev->dev;
ret = misc_register(&omap_wdt_miscdev);
if (ret)
goto fail;
Expand Down
5 changes: 1 addition & 4 deletions drivers/char/watchdog/pcwd_usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
#include <asm/uaccess.h>
#include <linux/usb.h>
#include <linux/mutex.h>
#include <linux/hid.h> /* For HID_REQ_SET_REPORT & HID_DT_REPORT */


#ifdef CONFIG_USB_DEBUG
Expand Down Expand Up @@ -109,10 +110,6 @@ MODULE_DEVICE_TABLE (usb, usb_pcwd_table);
#define CMD_ENABLE_WATCHDOG 0x30 /* Enable / Disable Watchdog */
#define CMD_DISABLE_WATCHDOG CMD_ENABLE_WATCHDOG

/* Some defines that I like to be somewhere else like include/linux/usb_hid.h */
#define HID_REQ_SET_REPORT 0x09
#define HID_DT_REPORT (USB_TYPE_CLASS | 0x02)

/* We can only use 1 card due to the /dev/watchdog restriction */
static int cards_found;

Expand Down
44 changes: 22 additions & 22 deletions drivers/char/watchdog/rm9k_wdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@


/* Function prototypes */
static irqreturn_t wdt_gpi_irqhdl(int, void *, struct pt_regs *);
static irqreturn_t wdt_gpi_irqhdl(int, void *);
static void wdt_gpi_start(void);
static void wdt_gpi_stop(void);
static void wdt_gpi_set_timeout(unsigned int);
Expand Down Expand Up @@ -94,8 +94,28 @@ module_param(nowayout, bool, 0444);
MODULE_PARM_DESC(nowayout, "Watchdog cannot be disabled once started");


/* Kernel interfaces */
static struct file_operations fops = {
.owner = THIS_MODULE,
.open = wdt_gpi_open,
.release = wdt_gpi_release,
.write = wdt_gpi_write,
.unlocked_ioctl = wdt_gpi_ioctl,
};

static struct miscdevice miscdev = {
.minor = WATCHDOG_MINOR,
.name = wdt_gpi_name,
.fops = &fops,
};

static struct notifier_block wdt_gpi_shutdown = {
.notifier_call = wdt_gpi_notify,
};


/* Interrupt handler */
static irqreturn_t wdt_gpi_irqhdl(int irq, void *ctxt, struct pt_regs *regs)
static irqreturn_t wdt_gpi_irqhdl(int irq, void *ctxt)
{
if (!unlikely(__raw_readl(wd_regs + 0x0008) & 0x1))
return IRQ_NONE;
Expand Down Expand Up @@ -312,26 +332,6 @@ wdt_gpi_notify(struct notifier_block *this, unsigned long code, void *unused)
}


/* Kernel interfaces */
static struct file_operations fops = {
.owner = THIS_MODULE,
.open = wdt_gpi_open,
.release = wdt_gpi_release,
.write = wdt_gpi_write,
.unlocked_ioctl = wdt_gpi_ioctl,
};

static struct miscdevice miscdev = {
.minor = WATCHDOG_MINOR,
.name = wdt_gpi_name,
.fops = &fops,
};

static struct notifier_block wdt_gpi_shutdown = {
.notifier_call = wdt_gpi_notify,
};


/* Init & exit procedures */
static const struct resource *
wdt_gpi_get_resource(struct platform_device *pdv, const char *name,
Expand Down

0 comments on commit d940505

Please sign in to comment.