diff options
author | Heikki Krogerus <heikki.krogerus@linux.intel.com> | 2016-01-25 12:03:46 +0300 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2016-02-24 09:12:45 +0100 |
commit | 648b50dd6abf8e6e5b589bb8e6873a4596389dbe (patch) | |
tree | e526a0a913b67e209252863132e75c55019c1557 /include/linux/rfkill.h | |
parent | 7837a7778268191dae5f6622f2b92b8b37cb8d7f (diff) | |
download | talos-obmc-linux-648b50dd6abf8e6e5b589bb8e6873a4596389dbe.tar.gz talos-obmc-linux-648b50dd6abf8e6e5b589bb8e6873a4596389dbe.zip |
net: rfkill: add rfkill_find_type function
Helper for finding the type based on name. Useful if the
type needs to be determined based on device property.
Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
[modify rfkill_types array and BUILD_BUG_ON to not cause errors]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'include/linux/rfkill.h')
-rw-r--r-- | include/linux/rfkill.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/include/linux/rfkill.h b/include/linux/rfkill.h index 7af625f6d226..e6a0031d1b1f 100644 --- a/include/linux/rfkill.h +++ b/include/linux/rfkill.h @@ -213,6 +213,15 @@ void rfkill_set_states(struct rfkill *rfkill, bool sw, bool hw); * @rfkill: rfkill struct to query */ bool rfkill_blocked(struct rfkill *rfkill); + +/** + * rfkill_find_type - Helpper for finding rfkill type by name + * @name: the name of the type + * + * Returns enum rfkill_type that conrresponds the name. + */ +enum rfkill_type rfkill_find_type(const char *name); + #else /* !RFKILL */ static inline struct rfkill * __must_check rfkill_alloc(const char *name, @@ -269,6 +278,12 @@ static inline bool rfkill_blocked(struct rfkill *rfkill) { return false; } + +static inline enum rfkill_type rfkill_find_type(const char *name) +{ + return RFKILL_TYPE_ALL; +} + #endif /* RFKILL || RFKILL_MODULE */ |