Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 324311
b: refs/heads/master
c: 09649a8
h: refs/heads/master
i:
  324309: add485c
  324307: 62fbd9c
  324303: cfe2e18
v: v3
  • Loading branch information
Tomas Winkler authored and Greg Kroah-Hartman committed Aug 16, 2012
1 parent 8750d76 commit be71d61
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 14 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: c216fdeb2e7371554c56ba457c374cce9c77f91a
refs/heads/master: 09649a85adfedde99b47b6ccef3fea696fad72be
29 changes: 16 additions & 13 deletions trunk/drivers/misc/mei/wd.c
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ static int mei_wd_ops_start(struct watchdog_device *wd_dev)
int err = -ENODEV;
struct mei_device *dev;

dev = pci_get_drvdata(mei_device);
dev = watchdog_get_drvdata(wd_dev);
if (!dev)
return -ENODEV;

Expand Down Expand Up @@ -231,8 +231,8 @@ static int mei_wd_ops_start(struct watchdog_device *wd_dev)
static int mei_wd_ops_stop(struct watchdog_device *wd_dev)
{
struct mei_device *dev;
dev = pci_get_drvdata(mei_device);

dev = watchdog_get_drvdata(wd_dev);
if (!dev)
return -ENODEV;

Expand All @@ -254,8 +254,8 @@ static int mei_wd_ops_ping(struct watchdog_device *wd_dev)
{
int ret = 0;
struct mei_device *dev;
dev = pci_get_drvdata(mei_device);

dev = watchdog_get_drvdata(wd_dev);
if (!dev)
return -ENODEV;

Expand Down Expand Up @@ -309,8 +309,8 @@ static int mei_wd_ops_ping(struct watchdog_device *wd_dev)
static int mei_wd_ops_set_timeout(struct watchdog_device *wd_dev, unsigned int timeout)
{
struct mei_device *dev;
dev = pci_get_drvdata(mei_device);

dev = watchdog_get_drvdata(wd_dev);
if (!dev)
return -ENODEV;

Expand Down Expand Up @@ -355,25 +355,28 @@ static struct watchdog_device amt_wd_dev = {
};


void mei_watchdog_register(struct mei_device *dev)
void mei_watchdog_register(struct mei_device *dev)
{
dev_dbg(&dev->pdev->dev, "dev->wd_timeout =%d.\n", dev->wd_timeout);

if (watchdog_register_device(&amt_wd_dev)) {
dev_err(&dev->pdev->dev,
"wd: unable to register watchdog device.\n");
dev->wd_interface_reg = false;
} else {
dev_dbg(&dev->pdev->dev,
"wd: successfully register watchdog interface.\n");
dev->wd_interface_reg = true;
return;
}

dev_dbg(&dev->pdev->dev,
"wd: successfully register watchdog interface.\n");
dev->wd_interface_reg = true;
watchdog_set_drvdata(&amt_wd_dev, dev);
}

void mei_watchdog_unregister(struct mei_device *dev)
{
if (dev->wd_interface_reg)
watchdog_unregister_device(&amt_wd_dev);
if (!dev->wd_interface_reg)
return;

watchdog_set_drvdata(&amt_wd_dev, NULL);
watchdog_unregister_device(&amt_wd_dev);
dev->wd_interface_reg = false;
}

0 comments on commit be71d61

Please sign in to comment.