Commit cb43cc0f authored by H Hartley Sweeten's avatar H Hartley Sweeten Committed by Greg Kroah-Hartman

staging: comedi: me_daq: use comedi_load_firmware()

Use comedi_load_firmware() instead of duplicating the code in a
private function.
Signed-off-by: default avatarH Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 41278f33
...@@ -33,7 +33,6 @@ ...@@ -33,7 +33,6 @@
#include <linux/pci.h> #include <linux/pci.h>
#include <linux/interrupt.h> #include <linux/interrupt.h>
#include <linux/sched.h> #include <linux/sched.h>
#include <linux/firmware.h>
#include "../comedidev.h" #include "../comedidev.h"
...@@ -456,22 +455,6 @@ static int me2600_xilinx_download(struct comedi_device *dev, ...@@ -456,22 +455,6 @@ static int me2600_xilinx_download(struct comedi_device *dev,
return 0; return 0;
} }
static int me2600_upload_firmware(struct comedi_device *dev)
{
struct pci_dev *pcidev = comedi_to_pci_dev(dev);
const struct firmware *fw;
int ret;
ret = request_firmware(&fw, ME2600_FIRMWARE, &pcidev->dev);
if (ret)
return ret;
ret = me2600_xilinx_download(dev, fw->data, fw->size);
release_firmware(fw);
return ret;
}
static int me_reset(struct comedi_device *dev) static int me_reset(struct comedi_device *dev)
{ {
struct me_private_data *dev_private = dev->private; struct me_private_data *dev_private = dev->private;
...@@ -525,7 +508,9 @@ static int me_auto_attach(struct comedi_device *dev, ...@@ -525,7 +508,9 @@ static int me_auto_attach(struct comedi_device *dev,
/* Download firmware and reset card */ /* Download firmware and reset card */
if (board->needs_firmware) { if (board->needs_firmware) {
ret = me2600_upload_firmware(dev); ret = comedi_load_firmware(dev, &comedi_to_pci_dev(dev)->dev,
ME2600_FIRMWARE,
me2600_xilinx_download);
if (ret < 0) if (ret < 0)
return ret; return ret;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment