aboutsummaryrefslogtreecommitdiffstats
path: root/net/rfkill
diff options
context:
space:
mode:
authorflorian@mickler.org <florian@mickler.org>2010-03-13 07:31:05 -0500
committerJohn W. Linville <linville@tuxdriver.com>2010-03-19 15:48:25 -0400
commit819bfecc4fc6b6e5a793f719a45b7146ce423b79 (patch)
treea7e646bf8032c29d7a1187301cdfa0d5b726473b /net/rfkill
parent09a08cff3d13315c948e6aee5cf912f8f1db54e7 (diff)
rename new rfkill sysfs knobs
This patch renames the (never officially released) sysfs-knobs "blocked_hw" and "blocked_sw" to "hard" and "soft", as the hardware vs software conotation is misleading. It also gets rid of not needed locks around u32-read-access. Signed-off-by: Florian Mickler <florian@mickler.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/rfkill')
-rw-r--r--net/rfkill/core.c35
1 files changed, 8 insertions, 27 deletions
diff --git a/net/rfkill/core.c b/net/rfkill/core.c
index 5f33151d70ae..7ae58b5b5a08 100644
--- a/net/rfkill/core.c
+++ b/net/rfkill/core.c
@@ -628,37 +628,25 @@ static ssize_t rfkill_persistent_show(struct device *dev,
628 return sprintf(buf, "%d\n", rfkill->persistent); 628 return sprintf(buf, "%d\n", rfkill->persistent);
629} 629}
630 630
631static ssize_t rfkill_blocked_hw_show(struct device *dev, 631static ssize_t rfkill_hard_show(struct device *dev,
632 struct device_attribute *attr, 632 struct device_attribute *attr,
633 char *buf) 633 char *buf)
634{ 634{
635 struct rfkill *rfkill = to_rfkill(dev); 635 struct rfkill *rfkill = to_rfkill(dev);
636 unsigned long flags;
637 u32 state;
638 636
639 spin_lock_irqsave(&rfkill->lock, flags); 637 return sprintf(buf, "%d\n", (rfkill->state & RFKILL_BLOCK_HW) ? 1 : 0 );
640 state = rfkill->state;
641 spin_unlock_irqrestore(&rfkill->lock, flags);
642
643 return sprintf(buf, "%d\n", (state & RFKILL_BLOCK_HW) ? 1 : 0 );
644} 638}
645 639
646static ssize_t rfkill_blocked_sw_show(struct device *dev, 640static ssize_t rfkill_soft_show(struct device *dev,
647 struct device_attribute *attr, 641 struct device_attribute *attr,
648 char *buf) 642 char *buf)
649{ 643{
650 struct rfkill *rfkill = to_rfkill(dev); 644 struct rfkill *rfkill = to_rfkill(dev);
651 unsigned long flags;
652 u32 state;
653
654 spin_lock_irqsave(&rfkill->lock, flags);
655 state = rfkill->state;
656 spin_unlock_irqrestore(&rfkill->lock, flags);
657 645
658 return sprintf(buf, "%d\n", (state & RFKILL_BLOCK_SW) ? 1 : 0 ); 646 return sprintf(buf, "%d\n", (rfkill->state & RFKILL_BLOCK_SW) ? 1 : 0 );
659} 647}
660 648
661static ssize_t rfkill_blocked_sw_store(struct device *dev, 649static ssize_t rfkill_soft_store(struct device *dev,
662 struct device_attribute *attr, 650 struct device_attribute *attr,
663 const char *buf, size_t count) 651 const char *buf, size_t count)
664{ 652{
@@ -698,14 +686,8 @@ static ssize_t rfkill_state_show(struct device *dev,
698 char *buf) 686 char *buf)
699{ 687{
700 struct rfkill *rfkill = to_rfkill(dev); 688 struct rfkill *rfkill = to_rfkill(dev);
701 unsigned long flags;
702 u32 state;
703
704 spin_lock_irqsave(&rfkill->lock, flags);
705 state = rfkill->state;
706 spin_unlock_irqrestore(&rfkill->lock, flags);
707 689
708 return sprintf(buf, "%d\n", user_state_from_blocked(state)); 690 return sprintf(buf, "%d\n", user_state_from_blocked(rfkill->state));
709} 691}
710 692
711static ssize_t rfkill_state_store(struct device *dev, 693static ssize_t rfkill_state_store(struct device *dev,
@@ -755,9 +737,8 @@ static struct device_attribute rfkill_dev_attrs[] = {
755 __ATTR(persistent, S_IRUGO, rfkill_persistent_show, NULL), 737 __ATTR(persistent, S_IRUGO, rfkill_persistent_show, NULL),
756 __ATTR(state, S_IRUGO|S_IWUSR, rfkill_state_show, rfkill_state_store), 738 __ATTR(state, S_IRUGO|S_IWUSR, rfkill_state_show, rfkill_state_store),
757 __ATTR(claim, S_IRUGO|S_IWUSR, rfkill_claim_show, rfkill_claim_store), 739 __ATTR(claim, S_IRUGO|S_IWUSR, rfkill_claim_show, rfkill_claim_store),
758 __ATTR(sw, S_IRUGO|S_IWUSR, rfkill_blocked_sw_show, 740 __ATTR(soft, S_IRUGO|S_IWUSR, rfkill_soft_show, rfkill_soft_store),
759 rfkill_blocked_sw_store), 741 __ATTR(hard, S_IRUGO, rfkill_hard_show, NULL),
760 __ATTR(hw, S_IRUGO, rfkill_blocked_hw_show, NULL),
761 __ATTR_NULL 742 __ATTR_NULL
762}; 743};
763 744