From cb43cc0f031563e09820360f215c16a4582a2618 Mon Sep 17 00:00:00 2001 From: H Hartley Sweeten Date: Fri, 17 May 2013 11:17:40 -0700 Subject: [PATCH] staging: comedi: me_daq: use comedi_load_firmware() Use comedi_load_firmware() instead of duplicating the code in a private function. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Signed-off-by: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/me_daq.c | 21 +++------------------ 1 file changed, 3 insertions(+), 18 deletions(-) diff --git a/drivers/staging/comedi/drivers/me_daq.c b/drivers/staging/comedi/drivers/me_daq.c index a5551e6c8555..313f702bb3f9 100644 --- a/drivers/staging/comedi/drivers/me_daq.c +++ b/drivers/staging/comedi/drivers/me_daq.c @@ -33,7 +33,6 @@ #include #include #include -#include #include "../comedidev.h" @@ -456,22 +455,6 @@ static int me2600_xilinx_download(struct comedi_device *dev, 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) { struct me_private_data *dev_private = dev->private; @@ -525,7 +508,9 @@ static int me_auto_attach(struct comedi_device *dev, /* Download firmware and reset card */ 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) return ret; } -- 2.20.1