linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Michael Buesch <mb@bu3sch.de>
To: John Linville <linville@tuxdriver.com>
Cc: bcm43xx-dev@lists.berlios.de, linux-wireless@vger.kernel.org
Subject: [PATCH] b43: Don't lock irq_lock in debugfs txpower adjust
Date: Wed, 19 Sep 2007 18:51:38 +0200	[thread overview]
Message-ID: <200709191851.38740.mb@bu3sch.de> (raw)

It's not required and the txpower adjustment must not be in atomic.

Signed-off-by: Michael Buesch <mb@bu3sch.de>

Index: wireless-dev/drivers/net/wireless/b43/debugfs.c
===================================================================
--- wireless-dev.orig/drivers/net/wireless/b43/debugfs.c	2007-09-19 18:13:49.000000000 +0200
+++ wireless-dev/drivers/net/wireless/b43/debugfs.c	2007-09-19 18:13:51.000000000 +0200
@@ -223,15 +223,10 @@ out:
 static int txpower_g_write_file(struct b43_wldev *dev,
 				const char *buf, size_t count)
 {
-	unsigned long flags;
 	unsigned long phy_flags;
-	int err = 0;
 
-	spin_lock_irqsave(&dev->wl->irq_lock, flags);
-	if (dev->phy.type != B43_PHYTYPE_G) {
-		err = -ENODEV;
-		goto out_unlock;
-	}
+	if (dev->phy.type != B43_PHYTYPE_G)
+		return -ENODEV;
 	if ((count >= 4) && (memcmp(buf, "auto", 4) == 0)) {
 		/* Automatic control */
 		dev->phy.manual_txpower_control = 0;
@@ -240,10 +235,8 @@ static int txpower_g_write_file(struct b
 		int bbatt = 0, rfatt = 0, txmix = 0, pa2db = 0, pa3db = 0;
 		/* Manual control */
 		if (sscanf(buf, "%d %d %d %d %d", &bbatt, &rfatt,
-			   &txmix, &pa2db, &pa3db) != 5) {
-			err = -EINVAL;
-			goto out_unlock;
-		}
+			   &txmix, &pa2db, &pa3db) != 5)
+			return -EINVAL;
 		b43_put_attenuation_into_ranges(dev, &bbatt, &rfatt);
 		dev->phy.manual_txpower_control = 1;
 		dev->phy.bbatt.att = bbatt;
@@ -262,10 +255,8 @@ static int txpower_g_write_file(struct b
 		b43_radio_unlock(dev);
 		b43_phy_unlock(dev, phy_flags);
 	}
-out_unlock:
-	spin_unlock_irqrestore(&dev->wl->irq_lock, flags);
 
-	return err;
+	return 0;
 }
 
 /* wl->irq_lock is locked */

                 reply	other threads:[~2007-09-19 16:52 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=200709191851.38740.mb@bu3sch.de \
    --to=mb@bu3sch.de \
    --cc=bcm43xx-dev@lists.berlios.de \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    /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).