]> git.karo-electronics.de Git - mv-sheeva.git/commitdiff
Staging: rts_pstor: s/rtsx_free_dma_buf/kfree/
authorAlexander Beregalov <a.beregalov@gmail.com>
Sat, 26 Mar 2011 17:18:11 +0000 (20:18 +0300)
committerGreg Kroah-Hartman <gregkh@suse.de>
Wed, 20 Apr 2011 20:45:57 +0000 (13:45 -0700)
Signed-off-by: Alexander Beregalov <a.beregalov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/rts_pstor/ms.c
drivers/staging/rts_pstor/rtsx.h
drivers/staging/rts_pstor/spi.c
drivers/staging/rts_pstor/xd.c

index 810e170894f58c3d3180047084dacc31014ec6cd..58fc7e07522634fe072c76212ca01509f6d9463e 100644 (file)
@@ -875,11 +875,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,
@@ -891,7 +891,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);
        }
 
@@ -899,7 +899,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);
                }
 
@@ -908,7 +908,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);
                }
 
@@ -916,18 +916,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);
        }
 
@@ -949,15 +949,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);
                        }
 
@@ -983,15 +983,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);
                        }
 
@@ -1004,7 +1004,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);
        }
 
@@ -1041,7 +1041,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)) {
@@ -3817,7 +3817,7 @@ int mg_get_local_EKB(struct scsi_cmnd *srb, struct rtsx_chip *chip)
 
 GetEKBFinish:
        if (buf) {
-               rtsx_free_dma_buf(chip, buf);
+               kfree(buf);
        }
        return retval;
 }
@@ -4055,7 +4055,7 @@ int mg_get_ICV(struct scsi_cmnd *srb, struct rtsx_chip *chip)
 
 GetICVFinish:
        if (buf) {
-               rtsx_free_dma_buf(chip, buf);
+               kfree(buf);
        }
        return retval;
 }
@@ -4156,7 +4156,7 @@ int mg_set_ICV(struct scsi_cmnd *srb, struct rtsx_chip *chip)
 
 SetICVFinish:
        if (buf) {
-               rtsx_free_dma_buf(chip, buf);
+               kfree(buf);
        }
        return retval;
 }
index 4d5ddf6fbb5e1af4dde7b6e57847d2514f0aae8d..263524c45aabbe1d8e2dec4b9dc9bedd3b3a75dc 100644 (file)
@@ -99,7 +99,6 @@ do {                                                  \
 #define SCSI_LUN(srb)          ((srb)->device->lun)
 
 #define rtsx_alloc_dma_buf(chip, size, flag)   kmalloc((size), (flag))
-#define rtsx_free_dma_buf(chip, ptr)           kfree((ptr))
 
 typedef unsigned long DELAY_PARA_T;
 
index 8a8689b327ae20e3c49353e8e1004aa984c6215e..3daab9ad48b8f2403a8b0c93add89a2be0c9fff4 100644 (file)
@@ -543,7 +543,7 @@ int spi_read_flash(struct scsi_cmnd *srb, struct rtsx_chip *chip)
 
                retval = rtsx_transfer_data(chip, 0, buf, pagelen, 0, DMA_FROM_DEVICE, 10000);
                if (retval < 0) {
-                       rtsx_free_dma_buf(chip, buf);
+                       kfree(buf);
                        rtsx_clear_spi_error(chip);
                        spi_set_err_code(chip, SPI_HW_ERR);
                        TRACE_RET(chip, STATUS_FAIL);
@@ -556,7 +556,7 @@ int spi_read_flash(struct scsi_cmnd *srb, struct rtsx_chip *chip)
        }
 
        scsi_set_resid(srb, 0);
-       rtsx_free_dma_buf(chip, buf);
+       kfree(buf);
 
        return STATUS_SUCCESS;
 }
@@ -591,7 +591,7 @@ int spi_write_flash(struct scsi_cmnd *srb, struct rtsx_chip *chip)
                while (len) {
                        retval = sf_enable_write(chip, SPI_WREN);
                        if (retval != STATUS_SUCCESS) {
-                               rtsx_free_dma_buf(chip, buf);
+                               kfree(buf);
                                TRACE_RET(chip, STATUS_FAIL);
                        }
 
@@ -605,7 +605,7 @@ int spi_write_flash(struct scsi_cmnd *srb, struct rtsx_chip *chip)
 
                        retval = rtsx_send_cmd(chip, 0, 100);
                        if (retval < 0) {
-                               rtsx_free_dma_buf(chip, buf);
+                               kfree(buf);
                                rtsx_clear_spi_error(chip);
                                spi_set_err_code(chip, SPI_HW_ERR);
                                TRACE_RET(chip, STATUS_FAIL);
@@ -613,7 +613,7 @@ int spi_write_flash(struct scsi_cmnd *srb, struct rtsx_chip *chip)
 
                        retval = sf_polling_status(chip, 100);
                        if (retval != STATUS_SUCCESS) {
-                               rtsx_free_dma_buf(chip, buf);
+                               kfree(buf);
                                TRACE_RET(chip, STATUS_FAIL);
                        }
 
@@ -621,7 +621,7 @@ int spi_write_flash(struct scsi_cmnd *srb, struct rtsx_chip *chip)
                        len--;
                }
 
-               rtsx_free_dma_buf(chip, buf);
+               kfree(buf);
 
        } else if (program_mode == AAI_PROGRAM) {
                int first_byte = 1;
@@ -650,7 +650,7 @@ int spi_write_flash(struct scsi_cmnd *srb, struct rtsx_chip *chip)
 
                        retval = rtsx_send_cmd(chip, 0, 100);
                        if (retval < 0) {
-                               rtsx_free_dma_buf(chip, buf);
+                               kfree(buf);
                                rtsx_clear_spi_error(chip);
                                spi_set_err_code(chip, SPI_HW_ERR);
                                TRACE_RET(chip, STATUS_FAIL);
@@ -658,14 +658,14 @@ int spi_write_flash(struct scsi_cmnd *srb, struct rtsx_chip *chip)
 
                        retval = sf_polling_status(chip, 100);
                        if (retval != STATUS_SUCCESS) {
-                               rtsx_free_dma_buf(chip, buf);
+                               kfree(buf);
                                TRACE_RET(chip, STATUS_FAIL);
                        }
 
                        len--;
                }
 
-               rtsx_free_dma_buf(chip, buf);
+               kfree(buf);
 
                retval = sf_disable_write(chip, SPI_WRDI);
                if (retval != STATUS_SUCCESS)
@@ -687,7 +687,7 @@ int spi_write_flash(struct scsi_cmnd *srb, struct rtsx_chip *chip)
 
                        retval = sf_enable_write(chip, SPI_WREN);
                        if (retval != STATUS_SUCCESS) {
-                               rtsx_free_dma_buf(chip, buf);
+                               kfree(buf);
                                TRACE_RET(chip, STATUS_FAIL);
                        }
 
@@ -702,7 +702,7 @@ int spi_write_flash(struct scsi_cmnd *srb, struct rtsx_chip *chip)
 
                        retval = rtsx_transfer_data(chip, 0, buf, pagelen, 0, DMA_TO_DEVICE, 100);
                        if (retval < 0) {
-                               rtsx_free_dma_buf(chip, buf);
+                               kfree(buf);
                                rtsx_clear_spi_error(chip);
                                spi_set_err_code(chip, SPI_HW_ERR);
                                TRACE_RET(chip, STATUS_FAIL);
@@ -710,7 +710,7 @@ int spi_write_flash(struct scsi_cmnd *srb, struct rtsx_chip *chip)
 
                        retval = sf_polling_status(chip, 100);
                        if (retval != STATUS_SUCCESS) {
-                               rtsx_free_dma_buf(chip, buf);
+                               kfree(buf);
                                TRACE_RET(chip, STATUS_FAIL);
                        }
 
@@ -718,7 +718,7 @@ int spi_write_flash(struct scsi_cmnd *srb, struct rtsx_chip *chip)
                        len -= pagelen;
                }
 
-               rtsx_free_dma_buf(chip, buf);
+               kfree(buf);
        } else {
                spi_set_err_code(chip, SPI_INVALID_COMMAND);
                TRACE_RET(chip, STATUS_FAIL);
index 7bcd468b8f2c2f15fff7e53cae3ce63b322c0bf6..b9eb072d74ee1f66156a73a82ed9e9e76735790e 100644 (file)
@@ -426,7 +426,7 @@ static void xd_clear_dma_buffer(struct rtsx_chip *chip)
                        rtsx_write_register(chip, CARD_STOP, SD_STOP | SD_CLR_ERR, SD_STOP | SD_CLR_ERR);
                }
 
-               rtsx_free_dma_buf(chip, buf);
+               kfree(buf);
 
                if (chip->asic_code) {
                        rtsx_write_register(chip, CARD_PULL_CTL2, 0xFF, 0x55);