aboutsummaryrefslogtreecommitdiffstats
path: root/net/rfkill/rfkill.c
diff options
context:
space:
mode:
authorMichael Buesch <mb@bu3sch.de>2007-09-27 15:34:23 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2007-10-10 19:54:11 -0400
commit20405c08412a4d89357870d7220f9fb1c458b286 (patch)
tree971dbbd3a2339eeef5ec7a89057cf6ca20af535d /net/rfkill/rfkill.c
parent135900c182c321a4888ec496b014e6707272faca (diff)
[RFKILL]: Add support for hardware-only rfkill buttons
Buttons that work directly on hardware cannot support the "user_claim" functionality. Add a flag to signal this and return -EOPNOTSUPP in this case. b43 is such a device. Signed-off-by: Michael Buesch <mb@bu3sch.de> Acked-by: Ivo van Doorn <IvDoorn@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/rfkill/rfkill.c')
-rw-r--r--net/rfkill/rfkill.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/net/rfkill/rfkill.c b/net/rfkill/rfkill.c
index a8c5e0b914e4..51d151c0e962 100644
--- a/net/rfkill/rfkill.c
+++ b/net/rfkill/rfkill.c
@@ -190,6 +190,10 @@ static ssize_t rfkill_claim_store(struct device *dev,
190 if (error) 190 if (error)
191 return error; 191 return error;
192 192
193 if (rfkill->user_claim_unsupported) {
194 error = -EOPNOTSUPP;
195 goto out_unlock;
196 }
193 if (rfkill->user_claim != claim) { 197 if (rfkill->user_claim != claim) {
194 if (!claim) 198 if (!claim)
195 rfkill_toggle_radio(rfkill, 199 rfkill_toggle_radio(rfkill,
@@ -197,9 +201,10 @@ static ssize_t rfkill_claim_store(struct device *dev,
197 rfkill->user_claim = claim; 201 rfkill->user_claim = claim;
198 } 202 }
199 203
204out_unlock:
200 mutex_unlock(&rfkill_mutex); 205 mutex_unlock(&rfkill_mutex);
201 206
202 return count; 207 return error ? error : count;
203} 208}
204 209
205static struct device_attribute rfkill_dev_attrs[] = { 210static struct device_attribute rfkill_dev_attrs[] = {