net: rfkill: add rfkill_find_type function
[sfrench/cifs-2.6.git] / include / linux / rfkill.h
index 7af625f6d226a4d16266107282668fdb9bfc3bdc..e6a0031d1b1fdc1793200d1fc93f48bf1973ecfc 100644 (file)
@@ -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 */