[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>
This commit is contained in:
committed by
David S. Miller
parent
135900c182
commit
20405c0841
@@ -190,6 +190,10 @@ static ssize_t rfkill_claim_store(struct device *dev,
|
||||
if (error)
|
||||
return error;
|
||||
|
||||
if (rfkill->user_claim_unsupported) {
|
||||
error = -EOPNOTSUPP;
|
||||
goto out_unlock;
|
||||
}
|
||||
if (rfkill->user_claim != claim) {
|
||||
if (!claim)
|
||||
rfkill_toggle_radio(rfkill,
|
||||
@@ -197,9 +201,10 @@ static ssize_t rfkill_claim_store(struct device *dev,
|
||||
rfkill->user_claim = claim;
|
||||
}
|
||||
|
||||
out_unlock:
|
||||
mutex_unlock(&rfkill_mutex);
|
||||
|
||||
return count;
|
||||
return error ? error : count;
|
||||
}
|
||||
|
||||
static struct device_attribute rfkill_dev_attrs[] = {
|
||||
|
Reference in New Issue
Block a user