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 /drivers/serial/ucc_uart.c | |
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 'drivers/serial/ucc_uart.c')
-rw-r--r-- | drivers/serial/ucc_uart.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/serial/ucc_uart.c b/drivers/serial/ucc_uart.c index 46de564aaea0..465f2fae1025 100644 --- a/drivers/serial/ucc_uart.c +++ b/drivers/serial/ucc_uart.c | |||
@@ -1179,16 +1179,18 @@ static void uart_firmware_cont(const struct firmware *fw, void *context) | |||
1179 | 1179 | ||
1180 | if (firmware->header.length != fw->size) { | 1180 | if (firmware->header.length != fw->size) { |
1181 | dev_err(dev, "invalid firmware\n"); | 1181 | dev_err(dev, "invalid firmware\n"); |
1182 | return; | 1182 | goto out; |
1183 | } | 1183 | } |
1184 | 1184 | ||
1185 | ret = qe_upload_firmware(firmware); | 1185 | ret = qe_upload_firmware(firmware); |
1186 | if (ret) { | 1186 | if (ret) { |
1187 | dev_err(dev, "could not load firmware\n"); | 1187 | dev_err(dev, "could not load firmware\n"); |
1188 | return; | 1188 | goto out; |
1189 | } | 1189 | } |
1190 | 1190 | ||
1191 | firmware_loaded = 1; | 1191 | firmware_loaded = 1; |
1192 | out: | ||
1193 | release_firmware(fw); | ||
1192 | } | 1194 | } |
1193 | 1195 | ||
1194 | static int ucc_uart_probe(struct of_device *ofdev, | 1196 | static int ucc_uart_probe(struct of_device *ofdev, |
@@ -1247,7 +1249,7 @@ static int ucc_uart_probe(struct of_device *ofdev, | |||
1247 | */ | 1249 | */ |
1248 | ret = request_firmware_nowait(THIS_MODULE, | 1250 | ret = request_firmware_nowait(THIS_MODULE, |
1249 | FW_ACTION_HOTPLUG, filename, &ofdev->dev, | 1251 | FW_ACTION_HOTPLUG, filename, &ofdev->dev, |
1250 | &ofdev->dev, uart_firmware_cont); | 1252 | GFP_KERNEL, &ofdev->dev, uart_firmware_cont); |
1251 | if (ret) { | 1253 | if (ret) { |
1252 | dev_err(&ofdev->dev, | 1254 | dev_err(&ofdev->dev, |
1253 | "could not load firmware %s\n", | 1255 | "could not load firmware %s\n", |