diff options
author | Marek Belisko <marek.belisko@gmail.com> | 2010-10-07 14:36:37 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-10-07 10:10:59 -0700 |
commit | ada541f0cb03eb3c39016597470bd0aaaa1c6486 (patch) | |
tree | 01157a5929f9938b5343bb1197a8104de178672f /drivers/staging/ft1000/ft1000-usb/ft1000_download.c | |
parent | 95624b2d75617bd16ffe4d698b645f468fbd0f20 (diff) |
staging: ft1000-usb: Add correct procedure for fw image downloading.
call request_firmware instead of trying to open the file directly from
the kernel driver.
Signed-off-by: Marek Belisko <marek.belisko@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging/ft1000/ft1000-usb/ft1000_download.c')
-rw-r--r-- | drivers/staging/ft1000/ft1000-usb/ft1000_download.c | 63 |
1 files changed, 0 insertions, 63 deletions
diff --git a/drivers/staging/ft1000/ft1000-usb/ft1000_download.c b/drivers/staging/ft1000/ft1000-usb/ft1000_download.c index ba07d5d8504..1f7c7a67e1d 100644 --- a/drivers/staging/ft1000/ft1000-usb/ft1000_download.c +++ b/drivers/staging/ft1000/ft1000-usb/ft1000_download.c @@ -132,69 +132,6 @@ typedef struct _DSP_IMAGE_INFO_V6 { unsigned short pad1; } DSP_IMAGE_INFO_V6, *PDSP_IMAGE_INFO_V6; - -//--------------------------------------------------------------------------- -// Function: getfw -// -// Parameters: char *fn - input DSP image file name -// int *pimgsz - output DSP image file size -// Returns: DSP image buffer -// -// Description: Read the DSP image file into a char buffer -// -// Notes: -// -//--------------------------------------------------------------------------- -char *getfw (char *fn, size_t *pimgsz) -{ - struct file *fd; - mm_segment_t fs = get_fs(); - loff_t pos; - char *pfwimg; - int fwimgsz; - - set_fs(get_ds()); - - fd = filp_open(fn, 0, 0); - if ( IS_ERR(fd) ) - { - DEBUG("FT1000:%s:can not open dsp image\n", __FUNCTION__); - set_fs(fs); - return NULL; - } - - fwimgsz = i_size_read(fd->f_dentry->d_inode); - *pimgsz = fwimgsz; - - if (fwimgsz <= 0) - { - DEBUG("FT1000:%s:invalid file size\n", __FUNCTION__); - filp_close(fd, current->files); - set_fs(fs); - return NULL; - } - pfwimg = (char*)vmalloc ( fwimgsz ); - if (pfwimg == NULL) { - DEBUG("FT1000:%s:can not allocate memory for dsp image\n", __FUNCTION__); - filp_close(fd, current->files); - set_fs(fs); - return NULL; - } - pos = 0; - if (vfs_read(fd, (void __user __force*)pfwimg, fwimgsz, &pos) != fwimgsz) { - vfree(pfwimg); - DEBUG("FT1000:%s:failed to read firmware image\n",__FUNCTION__); - filp_close(fd, current->files); - set_fs(fs); - return NULL; - } - - filp_close(fd, current->files); - set_fs(fs); - - return pfwimg; -} - //--------------------------------------------------------------------------- // Function: check_usb_db // |