mirror of
https://github.com/FEX-Emu/linux.git
synced 2025-01-11 11:56:48 +00:00
mei: use internal watchdog device registration tracking
remove bool wd_interface_reg as watchdog device already keeps track of its registration Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
15ea19105b
commit
c7d3df354d
@ -111,8 +111,6 @@ struct mei_device *mei_device_init(struct pci_dev *pdev)
|
|||||||
init_waitqueue_head(&dev->wait_stop_wd);
|
init_waitqueue_head(&dev->wait_stop_wd);
|
||||||
dev->dev_state = MEI_DEV_INITIALIZING;
|
dev->dev_state = MEI_DEV_INITIALIZING;
|
||||||
dev->iamthif_state = MEI_IAMTHIF_IDLE;
|
dev->iamthif_state = MEI_IAMTHIF_IDLE;
|
||||||
dev->wd_interface_reg = false;
|
|
||||||
|
|
||||||
|
|
||||||
mei_io_list_init(&dev->read_list);
|
mei_io_list_init(&dev->read_list);
|
||||||
mei_io_list_init(&dev->write_list);
|
mei_io_list_init(&dev->write_list);
|
||||||
|
@ -249,7 +249,6 @@ struct mei_device {
|
|||||||
|
|
||||||
struct mei_cl wd_cl;
|
struct mei_cl wd_cl;
|
||||||
enum mei_wd_states wd_state;
|
enum mei_wd_states wd_state;
|
||||||
bool wd_interface_reg;
|
|
||||||
bool wd_pending;
|
bool wd_pending;
|
||||||
u16 wd_timeout;
|
u16 wd_timeout;
|
||||||
unsigned char wd_data[MEI_WD_START_MSG_SIZE];
|
unsigned char wd_data[MEI_WD_START_MSG_SIZE];
|
||||||
|
@ -360,23 +360,20 @@ void mei_watchdog_register(struct mei_device *dev)
|
|||||||
if (watchdog_register_device(&amt_wd_dev)) {
|
if (watchdog_register_device(&amt_wd_dev)) {
|
||||||
dev_err(&dev->pdev->dev,
|
dev_err(&dev->pdev->dev,
|
||||||
"wd: unable to register watchdog device.\n");
|
"wd: unable to register watchdog device.\n");
|
||||||
dev->wd_interface_reg = false;
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
dev_dbg(&dev->pdev->dev,
|
dev_dbg(&dev->pdev->dev,
|
||||||
"wd: successfully register watchdog interface.\n");
|
"wd: successfully register watchdog interface.\n");
|
||||||
dev->wd_interface_reg = true;
|
|
||||||
watchdog_set_drvdata(&amt_wd_dev, dev);
|
watchdog_set_drvdata(&amt_wd_dev, dev);
|
||||||
}
|
}
|
||||||
|
|
||||||
void mei_watchdog_unregister(struct mei_device *dev)
|
void mei_watchdog_unregister(struct mei_device *dev)
|
||||||
{
|
{
|
||||||
if (!dev->wd_interface_reg)
|
if (test_bit(WDOG_UNREGISTERED, &amt_wd_dev.status))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
watchdog_set_drvdata(&amt_wd_dev, NULL);
|
watchdog_set_drvdata(&amt_wd_dev, NULL);
|
||||||
watchdog_unregister_device(&amt_wd_dev);
|
watchdog_unregister_device(&amt_wd_dev);
|
||||||
dev->wd_interface_reg = false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user