aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorMing Lei <ming.lei@canonical.com>2012-08-04 00:01:22 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-08-16 16:24:21 -0400
commit2887b3959c8b2f6ed1f62ce95c0888aedb1ea84b (patch)
treed8706698f44593c7c0075912c6e2a4b81ebf32a6 /include/linux
parent1f2b79599ee8f5fc82cc73c6c090eb6cdff881d6 (diff)
firmware loader: introduce cache_firmware and uncache_firmware
This patches introduce two kernel APIs of cache_firmware and uncache_firmware, both of which take the firmware file name as the only parameter. So any drivers can call cache_firmware to cache the specified firmware file into kernel memory, and can use the cached firmware in situations which can't request firmware from user space. Signed-off-by: Ming Lei <ming.lei@canonical.com> Cc: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/firmware.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/include/linux/firmware.h b/include/linux/firmware.h
index e85b771f3d8c..e4279fedb93a 100644
--- a/include/linux/firmware.h
+++ b/include/linux/firmware.h
@@ -47,6 +47,8 @@ int request_firmware_nowait(
47 void (*cont)(const struct firmware *fw, void *context)); 47 void (*cont)(const struct firmware *fw, void *context));
48 48
49void release_firmware(const struct firmware *fw); 49void release_firmware(const struct firmware *fw);
50int cache_firmware(const char *name);
51int uncache_firmware(const char *name);
50#else 52#else
51static inline int request_firmware(const struct firmware **fw, 53static inline int request_firmware(const struct firmware **fw,
52 const char *name, 54 const char *name,
@@ -65,6 +67,16 @@ static inline int request_firmware_nowait(
65static inline void release_firmware(const struct firmware *fw) 67static inline void release_firmware(const struct firmware *fw)
66{ 68{
67} 69}
70
71static inline int cache_firmware(const char *name)
72{
73 return -ENOENT;
74}
75
76static inline int uncache_firmware(const char *name)
77{
78 return -EINVAL;
79}
68#endif 80#endif
69 81
70#endif 82#endif