Merge tag 'clk-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git...
[linux.git] / drivers / base / firmware_loader / fallback.h
blobccf912bef6ca7865de4d48e2fb3ace0a68bb1ddc
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef __FIRMWARE_FALLBACK_H
3 #define __FIRMWARE_FALLBACK_H
5 #include <linux/firmware.h>
6 #include <linux/device.h>
8 #include "firmware.h"
9 #include "sysfs.h"
11 #ifdef CONFIG_FW_LOADER_USER_HELPER
12 int firmware_fallback_sysfs(struct firmware *fw, const char *name,
13 struct device *device,
14 u32 opt_flags,
15 int ret);
16 void kill_pending_fw_fallback_reqs(bool kill_all);
18 void fw_fallback_set_cache_timeout(void);
19 void fw_fallback_set_default_timeout(void);
21 #else /* CONFIG_FW_LOADER_USER_HELPER */
22 static inline int firmware_fallback_sysfs(struct firmware *fw, const char *name,
23 struct device *device,
24 u32 opt_flags,
25 int ret)
27 /* Keep carrying over the same error */
28 return ret;
31 static inline void kill_pending_fw_fallback_reqs(bool kill_all) { }
32 static inline void fw_fallback_set_cache_timeout(void) { }
33 static inline void fw_fallback_set_default_timeout(void) { }
34 #endif /* CONFIG_FW_LOADER_USER_HELPER */
36 #ifdef CONFIG_EFI_EMBEDDED_FIRMWARE
37 int firmware_fallback_platform(struct fw_priv *fw_priv);
38 #else
39 static inline int firmware_fallback_platform(struct fw_priv *fw_priv)
41 return -ENOENT;
43 #endif
45 #endif /* __FIRMWARE_FALLBACK_H */