Staging: rts_pstor: s/rtsx_alloc_dma_buf/kmalloc/
authorAlexander Beregalov <a.beregalov@gmail.com>
Sun, 27 Mar 2011 00:06:43 +0000 (04:06 +0400)
committerGreg Kroah-Hartman <gregkh@suse.de>
Wed, 20 Apr 2011 20:45:58 +0000 (13:45 -0700)
Replace rtsx_alloc_dma_buf() with kfree() back,
chip parameter is not used; remove casts.

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 58fc7e07522634fe072c76212ca01509f6d9463e..9975a59e52a3b04871614ba957d5e67f302ea3a7 100644 (file)
@@ -863,7 +863,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);
        }
@@ -3783,7 +3783,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);
        }
@@ -4021,7 +4021,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);
        }
@@ -4080,7 +4080,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);
        }
index 263524c45aabbe1d8e2dec4b9dc9bedd3b3a75dc..6afb6358e7750d902fedee8e9da3165be5d0d7ba 100644 (file)
@@ -98,8 +98,6 @@ do {                                                  \
 
 #define SCSI_LUN(srb)          ((srb)->device->lun)
 
-#define rtsx_alloc_dma_buf(chip, size, flag)   kmalloc((size), (flag))
-
 typedef unsigned long DELAY_PARA_T;
 
 struct rtsx_chip;
index 3daab9ad48b8f2403a8b0c93add89a2be0c9fff4..c803ba635509dc05ca523a9c46b79adf70f30aaf 100644 (file)
@@ -505,7 +505,7 @@ int spi_read_flash(struct scsi_cmnd *srb, struct rtsx_chip *chip)
                TRACE_RET(chip, STATUS_FAIL);
        }
 
-       buf = (u8 *)rtsx_alloc_dma_buf(chip, SF_PAGE_LEN, GFP_KERNEL);
+       buf = kmalloc(SF_PAGE_LEN, GFP_KERNEL);
        if (buf == NULL)
                TRACE_RET(chip, STATUS_ERROR);
 
@@ -584,7 +584,7 @@ int spi_write_flash(struct scsi_cmnd *srb, struct rtsx_chip *chip)
        }
 
        if (program_mode == BYTE_PROGRAM) {
-               buf = rtsx_alloc_dma_buf(chip, 4, GFP_KERNEL);
+               buf = kmalloc(4, GFP_KERNEL);
                if (!buf)
                        TRACE_RET(chip, STATUS_ERROR);
 
@@ -630,7 +630,7 @@ int spi_write_flash(struct scsi_cmnd *srb, struct rtsx_chip *chip)
                if (retval != STATUS_SUCCESS)
                        TRACE_RET(chip, STATUS_FAIL);
 
-               buf = rtsx_alloc_dma_buf(chip, 4, GFP_KERNEL);
+               buf = kmalloc(4, GFP_KERNEL);
                if (!buf)
                        TRACE_RET(chip, STATUS_ERROR);
 
@@ -675,7 +675,7 @@ int spi_write_flash(struct scsi_cmnd *srb, struct rtsx_chip *chip)
                if (retval != STATUS_SUCCESS)
                        TRACE_RET(chip, STATUS_FAIL);
        } else if (program_mode == PAGE_PROGRAM) {
-               buf = rtsx_alloc_dma_buf(chip, SF_PAGE_LEN, GFP_KERNEL);
+               buf = kmalloc(SF_PAGE_LEN, GFP_KERNEL);
                if (!buf)
                        TRACE_RET(chip, STATUS_NOMEM);
 
index b9eb072d74ee1f66156a73a82ed9e9e76735790e..a58a689fe9b5397473ac3cef7a4f782f00f713ab 100644 (file)
@@ -379,7 +379,7 @@ static void xd_clear_dma_buffer(struct rtsx_chip *chip)
 
                RTSX_DEBUGP("xD ECC error, dummy write!\n");
 
-               buf = (u8 *)rtsx_alloc_dma_buf(chip, 512, GFP_KERNEL);
+               buf = kmalloc(512, GFP_KERNEL);
                if (!buf)
                        return;