LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Pavel Machek <pavel@ucw.cz>
To: dmitry.torokhov@gmail.com, linux-input@vger.kernel.org,
	kernel list <linux-kernel@vger.kernel.org>,
	Linux-pm mailing list <linux-pm@lists.osdl.org>
Subject: power_state: remove from input & rfkill
Date: Sat, 23 Feb 2008 11:30:01 +0100	[thread overview]
Message-ID: <20080223103001.GA3837@elf.ucw.cz> (raw)


power_state is being removed from kernel, this time in input.

Signed-off-by: Pavel Machek <pavel@suse.cz>

diff --git a/drivers/input/serio/i8042.c b/drivers/input/serio/i8042.c
index 2763394..3816e44 100644
--- a/drivers/input/serio/i8042.c
+++ b/drivers/input/serio/i8042.c
@@ -895,13 +895,8 @@ #ifdef CONFIG_PM
 
 static int i8042_suspend(struct platform_device *dev, pm_message_t state)
 {
-	if (dev->dev.power.power_state.event != state.event) {
-		if (state.event == PM_EVENT_SUSPEND)
-			i8042_controller_reset();
-
-		dev->dev.power.power_state = state;
-	}
-
+	if (state.event == PM_EVENT_SUSPEND)
+		i8042_controller_reset();
 	return 0;
 }
 
@@ -914,12 +909,6 @@ static int i8042_resume(struct platform_
 {
 	int error;
 
-/*
- * Do not bother with restoring state if we haven't suspened yet
- */
-	if (dev->dev.power.power_state.event == PM_EVENT_ON)
-		return 0;
-
 	error = i8042_controller_check();
 	if (error)
 		return error;
@@ -954,9 +943,6 @@ static int i8042_resume(struct platform_
 		i8042_enable_kbd_port();
 
 	i8042_interrupt(0, NULL);
-
-	dev->dev.power.power_state = PMSG_ON;
-
 	return 0;
 }
 #endif /* CONFIG_PM */
diff --git a/drivers/input/serio/serio.c b/drivers/input/serio/serio.c
index 7f52938..0673f3a 100644
--- a/drivers/input/serio/serio.c
+++ b/drivers/input/serio/serio.c
@@ -912,13 +912,8 @@ #endif /* CONFIG_HOTPLUG */
 #ifdef CONFIG_PM
 static int serio_suspend(struct device *dev, pm_message_t state)
 {
-	if (dev->power.power_state.event != state.event) {
-		if (state.event == PM_EVENT_SUSPEND)
-			serio_cleanup(to_serio_port(dev));
-
-		dev->power.power_state = state;
-	}
-
+	if (state.event == PM_EVENT_SUSPEND)
+		serio_cleanup(to_serio_port(dev));
 	return 0;
 }
 
@@ -926,8 +921,7 @@ static int serio_resume(struct device *d
 {
 	struct serio *serio = to_serio_port(dev);
 
-	if (dev->power.power_state.event != PM_EVENT_ON &&
-	    serio_reconnect_driver(serio)) {
+	if (serio_reconnect_driver(serio)) {
 		/*
 		 * Driver re-probing can take a while, so better let kseriod
 		 * deal with it.
@@ -935,8 +929,6 @@ static int serio_resume(struct device *d
 		serio_rescan(serio);
 	}
 
-	dev->power.power_state = PMSG_ON;
-
 	return 0;
 }
 #endif /* CONFIG_PM */
diff --git a/net/rfkill/rfkill.c b/net/rfkill/rfkill.c
index 1a47f5d..81d7f5f 100644
--- a/net/rfkill/rfkill.c
+++ b/net/rfkill/rfkill.c
@@ -231,18 +231,14 @@ static int rfkill_suspend(struct device 
 {
 	struct rfkill *rfkill = to_rfkill(dev);
 
-	if (dev->power.power_state.event != state.event) {
-		if (state.event == PM_EVENT_SUSPEND) {
-			mutex_lock(&rfkill->mutex);
-
-			if (rfkill->state == RFKILL_STATE_ON)
-				rfkill->toggle_radio(rfkill->data,
-						     RFKILL_STATE_OFF);
+	if (state.event == PM_EVENT_SUSPEND) {
+		mutex_lock(&rfkill->mutex);
 
-			mutex_unlock(&rfkill->mutex);
-		}
+		if (rfkill->state == RFKILL_STATE_ON)
+			rfkill->toggle_radio(rfkill->data,
+					     RFKILL_STATE_OFF);
 
-		dev->power.power_state = state;
+		mutex_unlock(&rfkill->mutex);
 	}
 
 	return 0;
@@ -252,16 +248,12 @@ static int rfkill_resume(struct device *
 {
 	struct rfkill *rfkill = to_rfkill(dev);
 
-	if (dev->power.power_state.event != PM_EVENT_ON) {
-		mutex_lock(&rfkill->mutex);
+	mutex_lock(&rfkill->mutex);
 
-		if (rfkill->state == RFKILL_STATE_ON)
-			rfkill->toggle_radio(rfkill->data, RFKILL_STATE_ON);
+	if (rfkill->state == RFKILL_STATE_ON)
+		rfkill->toggle_radio(rfkill->data, RFKILL_STATE_ON);
 
-		mutex_unlock(&rfkill->mutex);
-	}
-
-	dev->power.power_state = PMSG_ON;
+	mutex_unlock(&rfkill->mutex);
 	return 0;
 }
 #else



-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

                 reply	other threads:[~2008-02-23 10:29 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20080223103001.GA3837@elf.ucw.cz \
    --to=pavel@ucw.cz \
    --cc=dmitry.torokhov@gmail.com \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@lists.osdl.org \
    --subject='Re: power_state: remove from input & rfkill' \
    /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

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).