aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/misc/mei/wd.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/misc/mei/wd.c')
-rw-r--r--drivers/misc/mei/wd.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/drivers/misc/mei/wd.c b/drivers/misc/mei/wd.c
index 8edb054d4b36..4fc2b3d4680a 100644
--- a/drivers/misc/mei/wd.c
+++ b/drivers/misc/mei/wd.c
@@ -360,23 +360,20 @@ void mei_watchdog_register(struct mei_device *dev)
360 if (watchdog_register_device(&amt_wd_dev)) { 360 if (watchdog_register_device(&amt_wd_dev)) {
361 dev_err(&dev->pdev->dev, 361 dev_err(&dev->pdev->dev,
362 "wd: unable to register watchdog device.\n"); 362 "wd: unable to register watchdog device.\n");
363 dev->wd_interface_reg = false;
364 return; 363 return;
365 } 364 }
366 365
367 dev_dbg(&dev->pdev->dev, 366 dev_dbg(&dev->pdev->dev,
368 "wd: successfully register watchdog interface.\n"); 367 "wd: successfully register watchdog interface.\n");
369 dev->wd_interface_reg = true;
370 watchdog_set_drvdata(&amt_wd_dev, dev); 368 watchdog_set_drvdata(&amt_wd_dev, dev);
371} 369}
372 370
373void mei_watchdog_unregister(struct mei_device *dev) 371void mei_watchdog_unregister(struct mei_device *dev)
374{ 372{
375 if (!dev->wd_interface_reg) 373 if (test_bit(WDOG_UNREGISTERED, &amt_wd_dev.status))
376 return; 374 return;
377 375
378 watchdog_set_drvdata(&amt_wd_dev, NULL); 376 watchdog_set_drvdata(&amt_wd_dev, NULL);
379 watchdog_unregister_device(&amt_wd_dev); 377 watchdog_unregister_device(&amt_wd_dev);
380 dev->wd_interface_reg = false;
381} 378}
382 379