fallback.h (1237B)
1/* SPDX-License-Identifier: GPL-2.0 */ 2#ifndef __FIRMWARE_FALLBACK_H 3#define __FIRMWARE_FALLBACK_H 4 5#include <linux/firmware.h> 6#include <linux/device.h> 7 8#include "firmware.h" 9#include "sysfs.h" 10 11#ifdef CONFIG_FW_LOADER_USER_HELPER 12int firmware_fallback_sysfs(struct firmware *fw, const char *name, 13 struct device *device, 14 u32 opt_flags, 15 int ret); 16void kill_pending_fw_fallback_reqs(bool only_kill_custom); 17 18void fw_fallback_set_cache_timeout(void); 19void fw_fallback_set_default_timeout(void); 20 21#else /* CONFIG_FW_LOADER_USER_HELPER */ 22static inline int firmware_fallback_sysfs(struct firmware *fw, const char *name, 23 struct device *device, 24 u32 opt_flags, 25 int ret) 26{ 27 /* Keep carrying over the same error */ 28 return ret; 29} 30 31static inline void kill_pending_fw_fallback_reqs(bool only_kill_custom) { } 32static inline void fw_fallback_set_cache_timeout(void) { } 33static inline void fw_fallback_set_default_timeout(void) { } 34#endif /* CONFIG_FW_LOADER_USER_HELPER */ 35 36#ifdef CONFIG_EFI_EMBEDDED_FIRMWARE 37int firmware_fallback_platform(struct fw_priv *fw_priv); 38#else 39static inline int firmware_fallback_platform(struct fw_priv *fw_priv) 40{ 41 return -ENOENT; 42} 43#endif 44 45#endif /* __FIRMWARE_FALLBACK_H */