diff options
author | H Hartley Sweeten <hsweeten@visionengravers.com> | 2013-05-17 11:18:01 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-05-17 12:09:50 -0700 |
commit | d569541e537e13136fc775a902cda06f4c48bbe1 (patch) | |
tree | 1be37af8602e082c8a29391255e478aa41949a48 /drivers/staging/comedi/drivers.c | |
parent | cb43cc0f031563e09820360f215c16a4582a2618 (diff) |
staging: comedi: ni_pcidio: use comedi_load_firmware()
Use comedi_load_firmware() instead of duplicating the code in a
private function.
This driver loads multiple firmware images to the device. Modify
comedi_load_firmware() to take a 'context' that is passed to the
firmware upload callback function.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/comedi/drivers.c')
-rw-r--r-- | drivers/staging/comedi/drivers.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/staging/comedi/drivers.c b/drivers/staging/comedi/drivers.c index 12f1974f2c81..f3e57fd8b2fb 100644 --- a/drivers/staging/comedi/drivers.c +++ b/drivers/staging/comedi/drivers.c @@ -353,12 +353,15 @@ static void comedi_report_boards(struct comedi_driver *driv) * @hw_device: device struct for the comedi_device * @name: the name of the firmware image * @cb: callback to the upload the firmware image + * @context: private context from the driver */ int comedi_load_firmware(struct comedi_device *dev, struct device *device, const char *name, int (*cb)(struct comedi_device *dev, - const u8 *data, size_t size)) + const u8 *data, size_t size, + unsigned long context), + unsigned long context) { const struct firmware *fw; int ret; @@ -368,7 +371,7 @@ int comedi_load_firmware(struct comedi_device *dev, ret = request_firmware(&fw, name, device); if (ret == 0) { - ret = cb(dev, fw->data, fw->size); + ret = cb(dev, fw->data, fw->size, context); release_firmware(fw); } |