Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

staging: mei: client init code cleanup

starting removing the dependency from the module parameters.
setting the default timeout on init so don't need to check if it is bigger
then zero.

Signed-off-by: Oren Weil <oren.jer.weil@intel.com>
Acked-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

authored by

Oren Weil and committed by
Greg Kroah-Hartman
2ad64ba8 6d70e935

+13 -20
+13 -20
drivers/staging/mei/wd.c
··· 72 72 73 73 /* look for WD client and connect to it */ 74 74 dev->wd_cl.state = MEI_FILE_DISCONNECTED; 75 - dev->wd_timeout = watchdog_timeout; 75 + dev->wd_timeout = AMT_WD_DEFAULT_TIMEOUT; 76 76 77 - if (dev->wd_timeout > 0) { 78 - /* find ME WD client */ 79 - mei_find_me_client_update_filext(dev, &dev->wd_cl, 80 - &mei_wd_guid, MEI_WD_HOST_CLIENT_ID); 77 + /* find ME WD client */ 78 + mei_find_me_client_update_filext(dev, &dev->wd_cl, 79 + &mei_wd_guid, MEI_WD_HOST_CLIENT_ID); 81 80 82 - dev_dbg(&dev->pdev->dev, "check wd_cl\n"); 83 - if (MEI_FILE_CONNECTING == dev->wd_cl.state) { 84 - if (!mei_connect(dev, &dev->wd_cl)) { 85 - dev_dbg(&dev->pdev->dev, "Failed to connect to WD client\n"); 86 - dev->wd_cl.state = MEI_FILE_DISCONNECTED; 87 - dev->wd_cl.host_client_id = 0; 88 - ret = false; 89 - goto end; 90 - } else { 91 - dev->wd_cl.timer_count = CONNECT_TIMEOUT; 92 - } 93 - } else { 94 - dev_dbg(&dev->pdev->dev, "Failed to find WD client\n"); 81 + dev_dbg(&dev->pdev->dev, "check wd_cl\n"); 82 + if (MEI_FILE_CONNECTING == dev->wd_cl.state) { 83 + if (!mei_connect(dev, &dev->wd_cl)) { 84 + dev_dbg(&dev->pdev->dev, "Failed to connect to WD client\n"); 85 + dev->wd_cl.state = MEI_FILE_DISCONNECTED; 86 + dev->wd_cl.host_client_id = 0; 95 87 ret = false; 96 88 goto end; 89 + } else { 90 + dev->wd_cl.timer_count = CONNECT_TIMEOUT; 97 91 } 98 92 } else { 99 - dev->wd_bypass = true; 100 - dev_dbg(&dev->pdev->dev, "WD requested to be disabled\n"); 93 + dev_dbg(&dev->pdev->dev, "Failed to find WD client\n"); 101 94 ret = false; 102 95 goto end; 103 96 }