diff options
Diffstat (limited to 'drivers/staging/rts_pstor/spi.c')
-rw-r--r-- | drivers/staging/rts_pstor/spi.c | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/drivers/staging/rts_pstor/spi.c b/drivers/staging/rts_pstor/spi.c index 8a8689b..c803ba6 100644 --- a/drivers/staging/rts_pstor/spi.c +++ b/drivers/staging/rts_pstor/spi.c @@ -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); @@ -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; } @@ -584,14 +584,14 @@ 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); 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; @@ -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); @@ -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) @@ -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); @@ -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); |