Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

firmware: provide stubs for the FW_LOADER=n case

libsas has a case where it uses the firmware loader to provide services,
but doesn't want to select it all the time. This currently causes a
compile failure in libsas if FW_LOADER=n. Fix this by providing error
stubs for the firmware loader API in the FW_LOADER=n case.

Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Cc: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

authored by

James Bottomley and committed by
Greg Kroah-Hartman
fbab976d 661b4e89

+23
+23
include/linux/firmware.h
··· 10 10 size_t size; 11 11 u8 *data; 12 12 }; 13 + 13 14 struct device; 15 + 16 + #if defined(CONFIG_FW_LOADER) || defined(CONFIG_FW_LOADER_MODULE) 14 17 int request_firmware(const struct firmware **fw, const char *name, 15 18 struct device *device); 16 19 int request_firmware_nowait( ··· 22 19 void (*cont)(const struct firmware *fw, void *context)); 23 20 24 21 void release_firmware(const struct firmware *fw); 22 + #else 23 + static inline int request_firmware(const struct firmware **fw, 24 + const char *name, 25 + struct device *device) 26 + { 27 + return -EINVAL; 28 + } 29 + static inline int request_firmware_nowait( 30 + struct module *module, int uevent, 31 + const char *name, struct device *device, void *context, 32 + void (*cont)(const struct firmware *fw, void *context)) 33 + { 34 + return -EINVAL; 35 + } 36 + 37 + static inline void release_firmware(const struct firmware *fw) 38 + { 39 + } 40 + #endif 41 + 25 42 #endif