diff options
Diffstat (limited to 'drivers/staging/rts5208/rtsx_scsi.c')
-rw-r--r-- | drivers/staging/rts5208/rtsx_scsi.c | 28 |
1 files changed, 12 insertions, 16 deletions
diff --git a/drivers/staging/rts5208/rtsx_scsi.c b/drivers/staging/rts5208/rtsx_scsi.c index d203104..becb4bb 100644 --- a/drivers/staging/rts5208/rtsx_scsi.c +++ b/drivers/staging/rts5208/rtsx_scsi.c @@ -484,14 +484,14 @@ static int inquiry(struct scsi_cmnd *srb, struct rtsx_chip *chip) u8 card = get_lun_card(chip, lun); bool pro_formatter_flag = false; unsigned char inquiry_buf[] = { - QULIFIRE|DRCT_ACCESS_DEV, - RMB_DISC|0x0D, + QULIFIRE | DRCT_ACCESS_DEV, + RMB_DISC | 0x0D, 0x00, 0x01, 0x1f, 0x02, 0, - REL_ADR|WBUS_32|WBUS_16|SYNC|LINKED|CMD_QUE|SFT_RE, + REL_ADR | WBUS_32 | WBUS_16 | SYNC | LINKED | CMD_QUE | SFT_RE, }; if (CHECK_LUN_MODE(chip, SD_MS_2LUN)) { @@ -558,7 +558,6 @@ static int inquiry(struct scsi_cmnd *srb, struct rtsx_chip *chip) return TRANSPORT_GOOD; } - static int start_stop_unit(struct scsi_cmnd *srb, struct rtsx_chip *chip) { unsigned int lun = SCSI_LUN(srb); @@ -594,7 +593,6 @@ static int start_stop_unit(struct scsi_cmnd *srb, struct rtsx_chip *chip) return TRANSPORT_ERROR; } - static int allow_medium_removal(struct scsi_cmnd *srb, struct rtsx_chip *chip) { int prevent; @@ -613,7 +611,6 @@ static int allow_medium_removal(struct scsi_cmnd *srb, struct rtsx_chip *chip) return TRANSPORT_GOOD; } - static int request_sense(struct scsi_cmnd *srb, struct rtsx_chip *chip) { struct sense_data_t *sense; @@ -1400,7 +1397,7 @@ static int trace_msg_cmd(struct scsi_cmnd *srb, struct rtsx_chip *chip) buf_len = 4 + ((2 + MSG_FUNC_LEN + MSG_FILE_LEN + TIME_VAL_LEN) * TRACE_ITEM_CNT); - if ((scsi_bufflen(srb) < buf_len) || (scsi_sglist(srb) == NULL)) { + if ((scsi_bufflen(srb) < buf_len) || !scsi_sglist(srb)) { set_sense_type(chip, SCSI_LUN(srb), SENSE_TYPE_MEDIA_UNRECOVER_READ_ERR); rtsx_trace(chip); @@ -1521,7 +1518,7 @@ static int write_host_reg(struct scsi_cmnd *srb, struct rtsx_chip *chip) static int set_variable(struct scsi_cmnd *srb, struct rtsx_chip *chip) { - unsigned lun = SCSI_LUN(srb); + unsigned int lun = SCSI_LUN(srb); if (srb->cmnd[3] == 1) { /* Variable Clock */ @@ -1989,8 +1986,8 @@ static int read_phy_register(struct scsi_cmnd *srb, struct rtsx_chip *chip) return TRANSPORT_FAILED; } - buf[2*i] = (u8)(val >> 8); - buf[2*i+1] = (u8)val; + buf[2 * i] = (u8)(val >> 8); + buf[2 * i + 1] = (u8)val; } len = (unsigned short)min_t(unsigned int, scsi_bufflen(srb), @@ -2048,7 +2045,7 @@ static int write_phy_register(struct scsi_cmnd *srb, struct rtsx_chip *chip) } for (i = 0; i < len / 2; i++) { - val = ((u16)buf[2*i] << 8) | buf[2*i+1]; + val = ((u16)buf[2 * i] << 8) | buf[2 * i + 1]; retval = rtsx_write_phy_register(chip, addr + i, val); if (retval != STATUS_SUCCESS) { vfree(buf); @@ -2604,7 +2601,6 @@ static int app_cmd(struct scsi_cmnd *srb, struct rtsx_chip *chip) return result; } - static int read_status(struct scsi_cmnd *srb, struct rtsx_chip *chip) { u8 rtsx_status[16]; @@ -3071,18 +3067,18 @@ static int get_ms_information(struct scsi_cmnd *srb, struct rtsx_chip *chip) buf[i++] = 0x80; if ((dev_info_id == 0x10) || (dev_info_id == 0x13)) { /* System Information */ - memcpy(buf+i, ms_card->raw_sys_info, 96); + memcpy(buf + i, ms_card->raw_sys_info, 96); } else { /* Model Name */ - memcpy(buf+i, ms_card->raw_model_name, 48); + memcpy(buf + i, ms_card->raw_model_name, 48); } rtsx_stor_set_xfer_buf(buf, buf_len, srb); if (dev_info_id == 0x15) - scsi_set_resid(srb, scsi_bufflen(srb)-0x3C); + scsi_set_resid(srb, scsi_bufflen(srb) - 0x3C); else - scsi_set_resid(srb, scsi_bufflen(srb)-0x6C); + scsi_set_resid(srb, scsi_bufflen(srb) - 0x6C); kfree(buf); return STATUS_SUCCESS; |