diff options
author | Tomas Winkler <tomas.winkler@intel.com> | 2013-02-06 14:06:44 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-02-06 11:24:33 -0800 |
commit | 074b4c01abb68c6767612a01f41e9b4ed93d5fb8 (patch) | |
tree | be333e9d5b652e7dab23e1fb8d7f57255b3e5729 /drivers/misc/mei/init.c | |
parent | 330dd7da5ec80e2c49c66bf353d8b4fa4fb8f5a9 (diff) | |
download | linux-3.10-074b4c01abb68c6767612a01f41e9b4ed93d5fb8.tar.gz linux-3.10-074b4c01abb68c6767612a01f41e9b4ed93d5fb8.tar.bz2 linux-3.10-074b4c01abb68c6767612a01f41e9b4ed93d5fb8.zip |
mei: move clients cleanup code from init.c to client.c
during reset we clean up client data structures
we move that code into wrappers in client
and call the wrappers
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/misc/mei/init.c')
-rw-r--r-- | drivers/misc/mei/init.c | 28 |
1 files changed, 6 insertions, 22 deletions
diff --git a/drivers/misc/mei/init.c b/drivers/misc/mei/init.c index 51a005e8095..6ec530168af 100644 --- a/drivers/misc/mei/init.c +++ b/drivers/misc/mei/init.c @@ -135,10 +135,6 @@ err: */ void mei_reset(struct mei_device *dev, int interrupts_enabled) { - struct mei_cl *cl_pos = NULL; - struct mei_cl *cl_next = NULL; - struct mei_cl_cb *cb_pos = NULL; - struct mei_cl_cb *cb_next = NULL; bool unexpected; if (dev->dev_state == MEI_DEV_RECOVERING_FROM_RESET) @@ -157,13 +153,8 @@ void mei_reset(struct mei_device *dev, int interrupts_enabled) dev->dev_state != MEI_DEV_POWER_DOWN) dev->dev_state = MEI_DEV_RESETING; - list_for_each_entry_safe(cl_pos, - cl_next, &dev->file_list, link) { - cl_pos->state = MEI_FILE_DISCONNECTED; - cl_pos->mei_flow_ctrl_creds = 0; - cl_pos->read_cb = NULL; - cl_pos->timer_count = 0; - } + mei_cl_all_disconnect(dev); + /* remove entry if already in list */ dev_dbg(&dev->pdev->dev, "remove iamthif and wd from the file list.\n"); mei_cl_unlink(&dev->wd_cl); @@ -185,18 +176,11 @@ void mei_reset(struct mei_device *dev, int interrupts_enabled) dev_warn(&dev->pdev->dev, "unexpected reset: dev_state = %s\n", mei_dev_state_str(dev->dev_state)); - /* Wake up all readings so they can be interrupted */ - list_for_each_entry_safe(cl_pos, cl_next, &dev->file_list, link) { - if (waitqueue_active(&cl_pos->rx_wait)) { - dev_dbg(&dev->pdev->dev, "Waking up client!\n"); - wake_up_interruptible(&cl_pos->rx_wait); - } - } + /* wake up all readings so they can be interrupted */ + mei_cl_all_read_wakeup(dev); + /* remove all waiting requests */ - list_for_each_entry_safe(cb_pos, cb_next, &dev->write_list.list, list) { - list_del(&cb_pos->list); - mei_io_cb_free(cb_pos); - } + mei_cl_all_write_clear(dev); } |