summaryrefslogtreecommitdiff
path: root/drivers/staging/rts_pstor/ms.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2011-05-23 12:49:28 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2011-05-23 12:49:28 -0700
commit1f3a8e093f470ef193b0ca6011d90180331c8b53 (patch)
tree66b7a58decabdc7f76ffb102899881c258c1df59 /drivers/staging/rts_pstor/ms.c
parentc44dead70a841d90ddc01968012f323c33217c9e (diff)
parent1a4b6f66285785ddccef049e6b45be4e7c7a2189 (diff)
Merge branch 'staging-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging-2.6
* 'staging-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging-2.6: (970 commits) staging: usbip: replace usbip_u{dbg,err,info} and printk with dev_ and pr_ staging:iio: Trivial kconfig reorganization and uniformity improvements. staging:iio:documenation partial update. staging:iio: use pollfunc allocation helpers in remaining drivers. staging:iio:max1363 misc cleanups and use of for_each_bit_set to simplify event code spitting out. staging:iio: implement an iio_info structure to take some of the constant elements out of iio_dev. staging:iio:meter:ade7758: Use private data space from iio_allocate_device staging:iio:accel:lis3l02dq make write_reg_8 take value not a pointer to value. staging:iio: ring core cleanups + check if read_last available in lis3l02dq staging:iio:core cleanup: squash tiny wrappers and use dev_set_name to handle creation of event interface name. staging:iio: poll func allocation clean up. staging:iio:ad7780 trivial unused header cleanup. staging:iio:adc: AD7780: Use private data space from iio_allocate_device + trivial fixes staging:iio:adc:AD7780: Convert to new channel registration method staging:iio:adc: AD7606: Drop dev_data in favour of iio_priv() staging:iio:adc: AD7606: Consitently use indio_dev staging:iio: Rip out helper for software rings. staging:iio:adc:AD7298: Use private data space from iio_allocate_device staging:iio: rationalization of different buffer implementation hooks. staging:iio:imu:adis16400 avoid allocating rx, tx, and state separately from iio_dev. ... Fix up trivial conflicts in - drivers/staging/intel_sst/intelmid.c: patches applied in both branches - drivers/staging/rt2860/common/cmm_data_{pci,usb}.c: removed vs spelling - drivers/staging/usbip/vhci_sysfs.c: trivial header file inclusion
Diffstat (limited to 'drivers/staging/rts_pstor/ms.c')
-rw-r--r--drivers/staging/rts_pstor/ms.c52
1 files changed, 23 insertions, 29 deletions
diff --git a/drivers/staging/rts_pstor/ms.c b/drivers/staging/rts_pstor/ms.c
index d89795c6a3ac..2e8258754c96 100644
--- a/drivers/staging/rts_pstor/ms.c
+++ b/drivers/staging/rts_pstor/ms.c
@@ -864,7 +864,7 @@ static int ms_read_attribute_info(struct rtsx_chip *chip)
TRACE_RET(chip, STATUS_FAIL);
}
- buf = (u8 *)rtsx_alloc_dma_buf(chip, 64 * 512, GFP_KERNEL);
+ buf = kmalloc(64 * 512, GFP_KERNEL);
if (buf == NULL) {
TRACE_RET(chip, STATUS_ERROR);
}
@@ -876,11 +876,11 @@ static int ms_read_attribute_info(struct rtsx_chip *chip)
}
retval = rtsx_read_register(chip, MS_TRANS_CFG, &val);
if (retval != STATUS_SUCCESS) {
- rtsx_free_dma_buf(chip, buf);
+ kfree(buf);
TRACE_RET(chip, STATUS_FAIL);
}
if (!(val & MS_INT_BREQ)) {
- rtsx_free_dma_buf(chip, buf);
+ kfree(buf);
TRACE_RET(chip, STATUS_FAIL);
}
retval = ms_transfer_data(chip, MS_TM_AUTO_READ, PRO_READ_LONG_DATA,
@@ -892,7 +892,7 @@ static int ms_read_attribute_info(struct rtsx_chip *chip)
}
}
if (retval != STATUS_SUCCESS) {
- rtsx_free_dma_buf(chip, buf);
+ kfree(buf);
TRACE_RET(chip, STATUS_FAIL);
}
@@ -900,7 +900,7 @@ static int ms_read_attribute_info(struct rtsx_chip *chip)
do {
retval = rtsx_read_register(chip, MS_TRANS_CFG, &val);
if (retval != STATUS_SUCCESS) {
- rtsx_free_dma_buf(chip, buf);
+ kfree(buf);
TRACE_RET(chip, STATUS_FAIL);
}
@@ -909,7 +909,7 @@ static int ms_read_attribute_info(struct rtsx_chip *chip)
retval = ms_transfer_tpc(chip, MS_TM_NORMAL_READ, PRO_READ_LONG_DATA, 0, WAIT_INT);
if (retval != STATUS_SUCCESS) {
- rtsx_free_dma_buf(chip, buf);
+ kfree(buf);
TRACE_RET(chip, STATUS_FAIL);
}
@@ -917,18 +917,18 @@ static int ms_read_attribute_info(struct rtsx_chip *chip)
} while (i < 1024);
if (retval != STATUS_SUCCESS) {
- rtsx_free_dma_buf(chip, buf);
+ kfree(buf);
TRACE_RET(chip, STATUS_FAIL);
}
if ((buf[0] != 0xa5) && (buf[1] != 0xc3)) {
/* Signature code is wrong */
- rtsx_free_dma_buf(chip, buf);
+ kfree(buf);
TRACE_RET(chip, STATUS_FAIL);
}
if ((buf[4] < 1) || (buf[4] > 12)) {
- rtsx_free_dma_buf(chip, buf);
+ kfree(buf);
TRACE_RET(chip, STATUS_FAIL);
}
@@ -950,15 +950,15 @@ static int ms_read_attribute_info(struct rtsx_chip *chip)
RTSX_DEBUGP("sys_info_addr = 0x%x, sys_info_size = 0x%x\n",
sys_info_addr, sys_info_size);
if (sys_info_size != 96) {
- rtsx_free_dma_buf(chip, buf);
+ kfree(buf);
TRACE_RET(chip, STATUS_FAIL);
}
if (sys_info_addr < 0x1A0) {
- rtsx_free_dma_buf(chip, buf);
+ kfree(buf);
TRACE_RET(chip, STATUS_FAIL);
}
if ((sys_info_size + sys_info_addr) > 0x8000) {
- rtsx_free_dma_buf(chip, buf);
+ kfree(buf);
TRACE_RET(chip, STATUS_FAIL);
}
@@ -984,15 +984,15 @@ static int ms_read_attribute_info(struct rtsx_chip *chip)
RTSX_DEBUGP("model_name_addr = 0x%x, model_name_size = 0x%x\n",
model_name_addr, model_name_size);
if (model_name_size != 48) {
- rtsx_free_dma_buf(chip, buf);
+ kfree(buf);
TRACE_RET(chip, STATUS_FAIL);
}
if (model_name_addr < 0x1A0) {
- rtsx_free_dma_buf(chip, buf);
+ kfree(buf);
TRACE_RET(chip, STATUS_FAIL);
}
if ((model_name_size + model_name_addr) > 0x8000) {
- rtsx_free_dma_buf(chip, buf);
+ kfree(buf);
TRACE_RET(chip, STATUS_FAIL);
}
@@ -1005,7 +1005,7 @@ static int ms_read_attribute_info(struct rtsx_chip *chip)
}
if (i == buf[4]) {
- rtsx_free_dma_buf(chip, buf);
+ kfree(buf);
TRACE_RET(chip, STATUS_FAIL);
}
@@ -1042,7 +1042,7 @@ static int ms_read_attribute_info(struct rtsx_chip *chip)
memcpy(ms_card->raw_model_name, buf + model_name_addr, 48);
#endif
- rtsx_free_dma_buf(chip, buf);
+ kfree(buf);
#ifdef SUPPORT_MSXC
if (CHK_MSXC(ms_card)) {
@@ -3784,7 +3784,7 @@ int mg_get_local_EKB(struct scsi_cmnd *srb, struct rtsx_chip *chip)
TRACE_RET(chip, STATUS_FAIL);
}
- buf = (u8 *)rtsx_alloc_dma_buf(chip, 1540, GFP_KERNEL);
+ buf = kmalloc(1540, GFP_KERNEL);
if (!buf) {
TRACE_RET(chip, STATUS_ERROR);
}
@@ -3817,9 +3817,7 @@ int mg_get_local_EKB(struct scsi_cmnd *srb, struct rtsx_chip *chip)
rtsx_stor_set_xfer_buf(buf, bufflen, srb);
GetEKBFinish:
- if (buf) {
- rtsx_free_dma_buf(chip, buf);
- }
+ kfree(buf);
return retval;
}
@@ -4022,7 +4020,7 @@ int mg_get_ICV(struct scsi_cmnd *srb, struct rtsx_chip *chip)
TRACE_RET(chip, STATUS_FAIL);
}
- buf = (u8 *)rtsx_alloc_dma_buf(chip, 1028, GFP_KERNEL);
+ buf = kmalloc(1028, GFP_KERNEL);
if (!buf) {
TRACE_RET(chip, STATUS_ERROR);
}
@@ -4055,9 +4053,7 @@ int mg_get_ICV(struct scsi_cmnd *srb, struct rtsx_chip *chip)
rtsx_stor_set_xfer_buf(buf, bufflen, srb);
GetICVFinish:
- if (buf) {
- rtsx_free_dma_buf(chip, buf);
- }
+ kfree(buf);
return retval;
}
@@ -4081,7 +4077,7 @@ int mg_set_ICV(struct scsi_cmnd *srb, struct rtsx_chip *chip)
TRACE_RET(chip, STATUS_FAIL);
}
- buf = (u8 *)rtsx_alloc_dma_buf(chip, 1028, GFP_KERNEL);
+ buf = kmalloc(1028, GFP_KERNEL);
if (!buf) {
TRACE_RET(chip, STATUS_ERROR);
}
@@ -4156,9 +4152,7 @@ int mg_set_ICV(struct scsi_cmnd *srb, struct rtsx_chip *chip)
#endif
SetICVFinish:
- if (buf) {
- rtsx_free_dma_buf(chip, buf);
- }
+ kfree(buf);
return retval;
}