All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mattia Dongili <malattia@linux.it>
To: Len Brown <lenb@kernel.org>
Cc: linux-acpi@vger.kernel.org, Mattia Dongili <malattia@linux.it>
Subject: [PATCH 12/14] sony-laptop: Make sony_pic_set_wwanpower not take mutexes
Date: Thu, 26 Mar 2009 21:58:23 +0900	[thread overview]
Message-ID: <1238072305-8085-13-git-send-email-malattia@linux.it> (raw)
In-Reply-To: <1238072305-8085-12-git-send-email-malattia@linux.it>

For consistency with __sony_pic_set_bluetoothpower, this is also needed
later to allow setting the wwanpower attribute from the resume path and
only lock the mutex once.

Signed-off-by: Mattia Dongili <malattia@linux.it>
---
 drivers/platform/x86/sony-laptop.c |   12 +++++-------
 1 files changed, 5 insertions(+), 7 deletions(-)

diff --git a/drivers/platform/x86/sony-laptop.c b/drivers/platform/x86/sony-laptop.c
index 3575a2d..8796dc6 100644
--- a/drivers/platform/x86/sony-laptop.c
+++ b/drivers/platform/x86/sony-laptop.c
@@ -2001,18 +2001,14 @@ int sony_pic_camera_command(int command, u8 value)
 EXPORT_SYMBOL(sony_pic_camera_command);
 
 /* gprs/edge modem (SZ460N and SZ210P), thanks to Joshua Wise */
-static void sony_pic_set_wwanpower(u8 state)
+static void __sony_pic_set_wwanpower(u8 state)
 {
 	state = !!state;
-	mutex_lock(&spic_dev.lock);
-	if (spic_dev.wwan_power == state) {
-		mutex_unlock(&spic_dev.lock);
+	if (spic_dev.wwan_power == state)
 		return;
-	}
 	sony_pic_call2(0xB0, state);
 	sony_pic_call1(0x82);
 	spic_dev.wwan_power = state;
-	mutex_unlock(&spic_dev.lock);
 }
 
 static ssize_t sony_pic_wwanpower_store(struct device *dev,
@@ -2024,7 +2020,9 @@ static ssize_t sony_pic_wwanpower_store(struct device *dev,
 		return -EINVAL;
 
 	value = simple_strtoul(buffer, NULL, 10);
-	sony_pic_set_wwanpower(value);
+	mutex_lock(&spic_dev.lock);
+	__sony_pic_set_wwanpower(value);
+	mutex_unlock(&spic_dev.lock);
 
 	return count;
 }
-- 
1.6.2


  reply	other threads:[~2009-03-26 12:58 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-26 12:58 [PATCH 0/14] sony-laptop for 2.6.30 Mattia Dongili
2009-03-26 12:58 ` [PATCH 01/14] sony-laptop: Add support for new Sony platform API Mattia Dongili
2009-03-26 12:58   ` [PATCH 02/14] sony-laptop: Enable EC on newer hardware Mattia Dongili
2009-03-26 12:58     ` [PATCH 03/14] sony-laptop: Add support for extra keyboard events Mattia Dongili
2009-03-26 12:58       ` [PATCH 04/14] sony-laptop: Add rfkill support on new models Mattia Dongili
2009-03-26 12:58         ` [PATCH 05/14] sony-laptop: Add support for extended hotkeys Mattia Dongili
2009-03-26 12:58           ` [PATCH 06/14] sony-laptop: merge Type4 into Type3 Mattia Dongili
2009-03-26 12:58             ` [PATCH 07/14] sony-laptop: VGN-A317M hotkey support Mattia Dongili
2009-03-26 12:58               ` [PATCH 08/14] sony-laptop: Eliminate BKL in ioctls Mattia Dongili
2009-03-26 12:58                 ` [PATCH 09/14] sony-laptop: detect the ICH9 chipset as Type3 Mattia Dongili
2009-03-26 12:58                   ` [PATCH 10/14] sony-laptop: notify the hardware of a state change in wwanpower Mattia Dongili
2009-03-26 12:58                     ` [PATCH 11/14] sony-laptop: Add FW specific hotkey events and DMI Mattia Dongili
2009-03-26 12:58                       ` Mattia Dongili [this message]
2009-03-26 12:58                         ` [PATCH 13/14] sony-laptop: update copyright Mattia Dongili
2009-03-26 12:58                           ` [PATCH 14/14] sony-laptop: Kill the BKL Mattia Dongili
2009-03-26 13:08                       ` [PATCH 11/14] sony-laptop: Add FW specific hotkey events and DMI Matthew Garrett
2009-03-26 13:21                         ` Mattia Dongili
2009-03-26 13:44                       ` [PATCH 11/14 v2] sony-laptop: Add FW specific hotkey events Mattia Dongili
2009-03-27 16:25 ` [PATCH 0/14] sony-laptop for 2.6.30 Len Brown

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=1238072305-8085-13-git-send-email-malattia@linux.it \
    --to=malattia@linux.it \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.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.