aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb
diff options
context:
space:
mode:
authorJohannes Berg <johannes@sipsolutions.net>2009-10-29 07:36:02 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2009-12-11 14:24:52 -0500
commit9ebfbd45f9d4ee9cd72529cf99e5f300eb398e67 (patch)
tree6ad661c4b38d0fad8a88c4a0d28997e9303632f2 /drivers/usb
parent03d673e6af6490371aaf64dfe1f84c658c48b71d (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/usb')
-rw-r--r--drivers/usb/atm/ueagle-atm.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/usb/atm/ueagle-atm.c b/drivers/usb/atm/ueagle-atm.c
index bba4d3eabe0f..c5395246886d 100644
--- a/drivers/usb/atm/ueagle-atm.c
+++ b/drivers/usb/atm/ueagle-atm.c
@@ -667,12 +667,12 @@ static void uea_upload_pre_firmware(const struct firmware *fw_entry, void *conte
667 else 667 else
668 uea_info(usb, "firmware uploaded\n"); 668 uea_info(usb, "firmware uploaded\n");
669 669
670 uea_leaves(usb); 670 goto err;
671 return;
672 671
673err_fw_corrupted: 672err_fw_corrupted:
674 uea_err(usb, "firmware is corrupted\n"); 673 uea_err(usb, "firmware is corrupted\n");
675err: 674err:
675 release_firmware(fw_entry);
676 uea_leaves(usb); 676 uea_leaves(usb);
677} 677}
678 678
@@ -705,7 +705,8 @@ static int uea_load_firmware(struct usb_device *usb, unsigned int ver)
705 break; 705 break;
706 } 706 }
707 707
708 ret = request_firmware_nowait(THIS_MODULE, 1, fw_name, &usb->dev, usb, uea_upload_pre_firmware); 708 ret = request_firmware_nowait(THIS_MODULE, 1, fw_name, &usb->dev,
709 GFP_KERNEL, usb, uea_upload_pre_firmware);
709 if (ret) 710 if (ret)
710 uea_err(usb, "firmware %s is not available\n", fw_name); 711 uea_err(usb, "firmware %s is not available\n", fw_name);
711 else 712 else