linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Oren Weil <oren.jer.weil@intel.com>
To: gregkh@suse.de
Cc: devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org,
	linux-watchdog@vger.kernel.org, alan@linux.intel.com,
	wim@iguana.be, tomas.winkler@intel.com,
	Oren Weil <oren.jer.weil@intel.com>
Subject: [PATCH 09/12 v2] stagign: mei: client init code cleanup
Date: Wed,  7 Sep 2011 09:03:15 +0300	[thread overview]
Message-ID: <1315375398-29529-10-git-send-email-oren.jer.weil@intel.com> (raw)
In-Reply-To: <1315375398-29529-1-git-send-email-oren.jer.weil@intel.com>

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>
---
 drivers/staging/mei/wd.c |   33 +++++++++++++--------------------
 1 files changed, 13 insertions(+), 20 deletions(-)

diff --git a/drivers/staging/mei/wd.c b/drivers/staging/mei/wd.c
index 68c177b..fd67952 100644
--- a/drivers/staging/mei/wd.c
+++ b/drivers/staging/mei/wd.c
@@ -72,32 +72,25 @@ bool mei_wd_host_init(struct mei_device *dev)
 
 	/* look for WD client and connect to it */
 	dev->wd_cl.state = MEI_FILE_DISCONNECTED;
-	dev->wd_timeout = watchdog_timeout;
-
-	if (dev->wd_timeout > 0) {
-		/* find ME WD client */
-		mei_find_me_client_update_filext(dev, &dev->wd_cl,
-					&mei_wd_guid, MEI_WD_HOST_CLIENT_ID);
-
-		dev_dbg(&dev->pdev->dev, "check wd_cl\n");
-		if (MEI_FILE_CONNECTING == dev->wd_cl.state) {
-			if (!mei_connect(dev, &dev->wd_cl)) {
-				dev_dbg(&dev->pdev->dev, "Failed to connect to WD client\n");
-				dev->wd_cl.state = MEI_FILE_DISCONNECTED;
-				dev->wd_cl.host_client_id = 0;
-				ret = false;
-				goto end;
-			} else {
-				dev->wd_cl.timer_count = CONNECT_TIMEOUT;
-			}
-		} else {
-			dev_dbg(&dev->pdev->dev, "Failed to find WD client\n");
+	dev->wd_timeout = AMT_WD_DEFAULT_TIMEOUT;
+
+	/* find ME WD client */
+	mei_find_me_client_update_filext(dev, &dev->wd_cl,
+				&mei_wd_guid, MEI_WD_HOST_CLIENT_ID);
+
+	dev_dbg(&dev->pdev->dev, "check wd_cl\n");
+	if (MEI_FILE_CONNECTING == dev->wd_cl.state) {
+		if (!mei_connect(dev, &dev->wd_cl)) {
+			dev_dbg(&dev->pdev->dev, "Failed to connect to WD client\n");
+			dev->wd_cl.state = MEI_FILE_DISCONNECTED;
+			dev->wd_cl.host_client_id = 0;
 			ret = false;
 			goto end;
+		} else {
+			dev->wd_cl.timer_count = CONNECT_TIMEOUT;
 		}
 	} else {
-		dev->wd_bypass = true;
-		dev_dbg(&dev->pdev->dev, "WD requested to be disabled\n");
+		dev_dbg(&dev->pdev->dev, "Failed to find WD client\n");
 		ret = false;
 		goto end;
 	}
-- 
1.7.4.1


  parent reply	other threads:[~2011-09-07  6:05 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-07  6:03 [PATCH 00/12 v2] staging: mei: adding new watchdog core support Oren Weil
2011-09-07  6:03 ` [PATCH 01/12 v2] staging: mei: removing dependency between WD and AMTHI init function Oren Weil
2011-09-07  6:03 ` [PATCH 02/12 v2] staging: mei: fix register access function comments Oren Weil
2011-09-07  6:03 ` [PATCH 03/12 v2] staging: mei: registering the MEI driver with the kernel watchdog core interface Oren Weil
2011-09-07  6:03 ` [PATCH 04/12 v2] staging: mei: adding watchdog ops Oren Weil
2011-09-07  6:03 ` [PATCH 05/12 v2] staging: mei: adding watchdog ping Oren Weil
2011-09-07  6:03 ` [PATCH 06/12 v2] staging: mei: adding set_timeout watchdog function Oren Weil
2011-09-07  6:03 ` [PATCH 07/12 v2] staging: mei: renaming delayed work field and function to a meaningful name Oren Weil
2011-09-07  6:03 ` [PATCH 08/12 v2] staging: mei: resuming timer regardless of the watchdog timeout value Oren Weil
2011-09-07  6:03 ` Oren Weil [this message]
2011-09-07  6:03 ` [PATCH 10/12 v2] staging: mei: removing wd module parameters Oren Weil
2011-09-07  6:03 ` [PATCH 11/12 v2] staging: mei: adding mei_wd_stop function comment Oren Weil
2011-09-07  6:03 ` Oren Weil

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1315375398-29529-10-git-send-email-oren.jer.weil@intel.com \
    --to=oren.jer.weil@intel.com \
    --cc=alan@linux.intel.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-watchdog@vger.kernel.org \
    --cc=tomas.winkler@intel.com \
    --cc=wim@iguana.be \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).