All of lore.kernel.org
 help / color / mirror / Atom feed
From: Xiaotian Feng <xtfeng@gmail.com>
To: tj@kernel.org
Cc: Xiaotian Feng <xtfeng@gmail.com>,
	Xiaotian Feng <dannyfeng@tencent.com>,
	Neela Syam Kolli <megaraidlinux@lsi.com>,
	"James E.J. Bottomley" <JBottomley@parallels.com>,
	linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] megaraid: convert to work_struct
Date: Thu, 13 Dec 2012 16:53:18 +0800	[thread overview]
Message-ID: <1355388798-12869-1-git-send-email-xtfeng@gmail.com> (raw)

There's no need to use delayed work, convert to use work_struct and
cancel_work_sync().

Requested-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Xiaotian Feng <dannyfeng@tencent.com>
Cc: Neela Syam Kolli <megaraidlinux@lsi.com>
Cc: "James E.J. Bottomley" <JBottomley@parallels.com>
Cc: linux-scsi@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
---
 drivers/scsi/megaraid/megaraid_sas.h      |    2 +-
 drivers/scsi/megaraid/megaraid_sas_base.c |   15 +++++++--------
 2 files changed, 8 insertions(+), 9 deletions(-)

diff --git a/drivers/scsi/megaraid/megaraid_sas.h b/drivers/scsi/megaraid/megaraid_sas.h
index 3b2365c..16b7a72 100644
--- a/drivers/scsi/megaraid/megaraid_sas.h
+++ b/drivers/scsi/megaraid/megaraid_sas.h
@@ -1276,7 +1276,7 @@ struct megasas_evt_detail {
 } __attribute__ ((packed));
 
 struct megasas_aen_event {
-	struct delayed_work hotplug_work;
+	struct work_struct hotplug_work;
 	struct megasas_instance *instance;
 };
 
diff --git a/drivers/scsi/megaraid/megaraid_sas_base.c b/drivers/scsi/megaraid/megaraid_sas_base.c
index e4f2baa..416b280 100644
--- a/drivers/scsi/megaraid/megaraid_sas_base.c
+++ b/drivers/scsi/megaraid/megaraid_sas_base.c
@@ -2060,9 +2060,8 @@ megasas_service_aen(struct megasas_instance *instance, struct megasas_cmd *cmd)
 		} else {
 			ev->instance = instance;
 			instance->ev = ev;
-			INIT_DELAYED_WORK(&ev->hotplug_work,
-					  megasas_aen_polling);
-			schedule_delayed_work(&ev->hotplug_work, 0);
+			INIT_WORK(&ev->hotplug_work, megasas_aen_polling);
+			schedule_work(&ev->hotplug_work);
 		}
 	}
 }
@@ -4349,10 +4348,10 @@ megasas_suspend(struct pci_dev *pdev, pm_message_t state)
 	megasas_flush_cache(instance);
 	megasas_shutdown_controller(instance, MR_DCMD_HIBERNATE_SHUTDOWN);
 
-	/* cancel the delayed work if this work still in queue */
+	/* cancel the work if this work still in queue */
 	if (instance->ev != NULL) {
 		struct megasas_aen_event *ev = instance->ev;
-		cancel_delayed_work_sync(&ev->hotplug_work);
+		cancel_work_sync(&ev->hotplug_work);
 		instance->ev = NULL;
 	}
 
@@ -4541,10 +4540,10 @@ static void __devexit megasas_detach_one(struct pci_dev *pdev)
 	megasas_flush_cache(instance);
 	megasas_shutdown_controller(instance, MR_DCMD_CTRL_SHUTDOWN);
 
-	/* cancel the delayed work if this work still in queue*/
+	/* cancel the work if this work still in queue*/
 	if (instance->ev != NULL) {
 		struct megasas_aen_event *ev = instance->ev;
-		cancel_delayed_work_sync(&ev->hotplug_work);
+		cancel_work_sync(&ev->hotplug_work);
 		instance->ev = NULL;
 	}
 
@@ -5188,7 +5187,7 @@ static void
 megasas_aen_polling(struct work_struct *work)
 {
 	struct megasas_aen_event *ev =
-		container_of(work, struct megasas_aen_event, hotplug_work.work);
+		container_of(work, struct megasas_aen_event, hotplug_work);
 	struct megasas_instance *instance = ev->instance;
 	union megasas_evt_class_locale class_locale;
 	struct  Scsi_Host *host;
-- 
1.7.9.5

             reply	other threads:[~2012-12-13  8:53 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-13  8:53 Xiaotian Feng [this message]
2012-12-18 16:59 ` [PATCH] megaraid: convert to work_struct Tejun Heo

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=1355388798-12869-1-git-send-email-xtfeng@gmail.com \
    --to=xtfeng@gmail.com \
    --cc=JBottomley@parallels.com \
    --cc=dannyfeng@tencent.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=megaraidlinux@lsi.com \
    --cc=tj@kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.