mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-06 19:08:57 +09:00
UPSTREAM: scsi: ufs: Use scsi_cmd_to_rq() instead of scsi_cmnd.request
Prepare for removal of the request pointer by using scsi_cmd_to_rq()
instead. This patch does not change any functionality.
Link: https://lore.kernel.org/r/20210809230355.8186-48-bvanassche@acm.org
Reviewed-by: Daejun Park <daejun7.park@samsung.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Bug: 204438323
(cherry picked from commit 3f2c1002e0)
Signed-off-by: Bart Van Assche <bvanassche@google.com>
Change-Id: Ia097ab3da630dcadd70fb8efbfd212e60cfcc79c
This commit is contained in:
committed by
Bart Van Assche
parent
435df62d65
commit
5ee37d89d5
@@ -379,6 +379,7 @@ static void ufshcd_add_command_trace(struct ufs_hba *hba, unsigned int tag,
|
||||
u32 intr, doorbell;
|
||||
struct ufshcd_lrb *lrbp = &hba->lrb[tag];
|
||||
struct scsi_cmnd *cmd = lrbp->cmd;
|
||||
struct request *rq = scsi_cmd_to_rq(cmd);
|
||||
int transfer_len = -1;
|
||||
|
||||
if (!cmd)
|
||||
@@ -404,7 +405,7 @@ static void ufshcd_add_command_trace(struct ufs_hba *hba, unsigned int tag,
|
||||
/*
|
||||
* The number of Bytes to be unmapped beginning with the lba.
|
||||
*/
|
||||
transfer_len = blk_rq_bytes(cmd->request);
|
||||
transfer_len = blk_rq_bytes(rq);
|
||||
}
|
||||
|
||||
intr = ufshcd_readl(hba, REG_INTERRUPT_STATUS);
|
||||
@@ -2073,7 +2074,7 @@ static void ufshcd_update_monitor(struct ufs_hba *hba, struct ufshcd_lrb *lrbp)
|
||||
|
||||
spin_lock_irqsave(hba->host->host_lock, flags);
|
||||
if (dir >= 0 && hba->monitor.nr_queued[dir] > 0) {
|
||||
struct request *req = lrbp->cmd->request;
|
||||
struct request *req = scsi_cmd_to_rq(lrbp->cmd);
|
||||
struct ufs_hba_monitor *m = &hba->monitor;
|
||||
ktime_t now, inc, lat;
|
||||
|
||||
@@ -2702,7 +2703,7 @@ static void ufshcd_init_lrb(struct ufs_hba *hba, struct ufshcd_lrb *lrb, int i)
|
||||
static int ufshcd_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *cmd)
|
||||
{
|
||||
struct ufs_hba *hba = shost_priv(host);
|
||||
int tag = cmd->request->tag;
|
||||
int tag = scsi_cmd_to_rq(cmd)->tag;
|
||||
struct ufshcd_lrb *lrbp;
|
||||
int err = 0;
|
||||
|
||||
@@ -2761,7 +2762,7 @@ static int ufshcd_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *cmd)
|
||||
lrbp->lun = ufshcd_scsi_to_upiu_lun(cmd->device->lun);
|
||||
lrbp->intr_cmd = !ufshcd_is_intr_aggr_allowed(hba) ? true : false;
|
||||
|
||||
ufshcd_prepare_lrbp_crypto(cmd->request, lrbp);
|
||||
ufshcd_prepare_lrbp_crypto(scsi_cmd_to_rq(cmd), lrbp);
|
||||
|
||||
trace_android_vh_ufs_prepare_command(hba, cmd->request, lrbp, &err);
|
||||
if (err) {
|
||||
@@ -6998,7 +6999,7 @@ static int ufshcd_abort(struct scsi_cmnd *cmd)
|
||||
{
|
||||
struct Scsi_Host *host = cmd->device->host;
|
||||
struct ufs_hba *hba = shost_priv(host);
|
||||
int tag = cmd->request->tag;
|
||||
int tag = scsi_cmd_to_rq(cmd)->tag;
|
||||
struct ufshcd_lrb *lrbp = &hba->lrb[tag];
|
||||
unsigned long flags;
|
||||
int err = FAILED, res;
|
||||
|
||||
Reference in New Issue
Block a user