diff options
author | Johannes Berg <johannes@sipsolutions.net> | 2009-10-29 07:36:02 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2009-12-11 14:24:52 -0500 |
commit | 9ebfbd45f9d4ee9cd72529cf99e5f300eb398e67 (patch) | |
tree | 6ad661c4b38d0fad8a88c4a0d28997e9303632f2 /include/linux/firmware.h | |
parent | 03d673e6af6490371aaf64dfe1f84c658c48b71d (diff) |
firmware_class: make request_firmware_nowait more useful
Unfortunately, one cannot hold on to the struct firmware
that request_firmware_nowait() hands off, which is needed
in some cases. Allow this by requiring the callback to
free it (via release_firmware).
Additionally, give it a gfp_t parameter -- all the current
users call it from a GFP_KERNEL context so the GFP_ATOMIC
isn't necessary. This also marks an API break which is
useful in a sense, although that is obviously not the
primary purpose of this change.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Cc: Ming Lei <tom.leiming@gmail.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: David Woodhouse <David.Woodhouse@intel.com>
Cc: Pavel Roskin <proski@gnu.org>
Cc: Abhay Salunke <abhay_salunke@dell.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'include/linux/firmware.h')
-rw-r--r-- | include/linux/firmware.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/include/linux/firmware.h b/include/linux/firmware.h index d31544628436..043811f0d277 100644 --- a/include/linux/firmware.h +++ b/include/linux/firmware.h | |||
@@ -4,6 +4,7 @@ | |||
4 | #include <linux/module.h> | 4 | #include <linux/module.h> |
5 | #include <linux/types.h> | 5 | #include <linux/types.h> |
6 | #include <linux/compiler.h> | 6 | #include <linux/compiler.h> |
7 | #include <linux/gfp.h> | ||
7 | 8 | ||
8 | #define FW_ACTION_NOHOTPLUG 0 | 9 | #define FW_ACTION_NOHOTPLUG 0 |
9 | #define FW_ACTION_HOTPLUG 1 | 10 | #define FW_ACTION_HOTPLUG 1 |
@@ -38,7 +39,7 @@ int request_firmware(const struct firmware **fw, const char *name, | |||
38 | struct device *device); | 39 | struct device *device); |
39 | int request_firmware_nowait( | 40 | int request_firmware_nowait( |
40 | struct module *module, int uevent, | 41 | struct module *module, int uevent, |
41 | const char *name, struct device *device, void *context, | 42 | const char *name, struct device *device, gfp_t gfp, void *context, |
42 | void (*cont)(const struct firmware *fw, void *context)); | 43 | void (*cont)(const struct firmware *fw, void *context)); |
43 | 44 | ||
44 | void release_firmware(const struct firmware *fw); | 45 | void release_firmware(const struct firmware *fw); |
@@ -51,7 +52,7 @@ static inline int request_firmware(const struct firmware **fw, | |||
51 | } | 52 | } |
52 | static inline int request_firmware_nowait( | 53 | static inline int request_firmware_nowait( |
53 | struct module *module, int uevent, | 54 | struct module *module, int uevent, |
54 | const char *name, struct device *device, void *context, | 55 | const char *name, struct device *device, gfp_t gfp, void *context, |
55 | void (*cont)(const struct firmware *fw, void *context)) | 56 | void (*cont)(const struct firmware *fw, void *context)) |
56 | { | 57 | { |
57 | return -EINVAL; | 58 | return -EINVAL; |