Commit f363b943 authored by Andrew Vasquez's avatar Andrew Vasquez Committed by James Bottomley

[SCSI] qla2xxx: Use shost_priv().

Drop usage of legacy to_qla_host() macro.
Signed-off-by: default avatarAndrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@SteelEye.com>
parent e745759a
This diff is collapsed.
...@@ -1402,7 +1402,7 @@ qla2x00_print_scsi_cmd(struct scsi_cmnd * cmd) ...@@ -1402,7 +1402,7 @@ qla2x00_print_scsi_cmd(struct scsi_cmnd * cmd)
struct scsi_qla_host *ha; struct scsi_qla_host *ha;
srb_t *sp; srb_t *sp;
ha = (struct scsi_qla_host *)cmd->device->host->hostdata; ha = shost_priv(cmd->device->host);
sp = (srb_t *) cmd->SCp.ptr; sp = (srb_t *) cmd->SCp.ptr;
printk("SCSI Command @=0x%p, Handle=0x%p\n", cmd, cmd->host_scribble); printk("SCSI Command @=0x%p, Handle=0x%p\n", cmd, cmd->host_scribble);
......
...@@ -2545,8 +2545,6 @@ typedef struct scsi_qla_host { ...@@ -2545,8 +2545,6 @@ typedef struct scsi_qla_host {
test_bit(LOOP_RESYNC_NEEDED, &ha->dpc_flags) || \ test_bit(LOOP_RESYNC_NEEDED, &ha->dpc_flags) || \
atomic_read(&ha->loop_state) == LOOP_DOWN) atomic_read(&ha->loop_state) == LOOP_DOWN)
#define to_qla_host(x) ((scsi_qla_host_t *) (x)->hostdata)
#define qla_printk(level, ha, format, arg...) \ #define qla_printk(level, ha, format, arg...) \
dev_printk(level , &((ha)->pdev->dev) , format , ## arg) dev_printk(level , &((ha)->pdev->dev) , format , ## arg)
......
...@@ -363,7 +363,7 @@ qla2x00_do_dpc_all_vps(scsi_qla_host_t *ha) ...@@ -363,7 +363,7 @@ qla2x00_do_dpc_all_vps(scsi_qla_host_t *ha)
int int
qla24xx_vport_create_req_sanity_check(struct fc_vport *fc_vport) qla24xx_vport_create_req_sanity_check(struct fc_vport *fc_vport)
{ {
scsi_qla_host_t *ha = (scsi_qla_host_t *) fc_vport->shost->hostdata; scsi_qla_host_t *ha = shost_priv(fc_vport->shost);
scsi_qla_host_t *vha; scsi_qla_host_t *vha;
uint8_t port_name[WWN_SIZE]; uint8_t port_name[WWN_SIZE];
...@@ -397,7 +397,7 @@ qla24xx_vport_create_req_sanity_check(struct fc_vport *fc_vport) ...@@ -397,7 +397,7 @@ qla24xx_vport_create_req_sanity_check(struct fc_vport *fc_vport)
scsi_qla_host_t * scsi_qla_host_t *
qla24xx_create_vhost(struct fc_vport *fc_vport) qla24xx_create_vhost(struct fc_vport *fc_vport)
{ {
scsi_qla_host_t *ha = (scsi_qla_host_t *) fc_vport->shost->hostdata; scsi_qla_host_t *ha = shost_priv(fc_vport->shost);
scsi_qla_host_t *vha; scsi_qla_host_t *vha;
struct Scsi_Host *host; struct Scsi_Host *host;
...@@ -409,7 +409,7 @@ qla24xx_create_vhost(struct fc_vport *fc_vport) ...@@ -409,7 +409,7 @@ qla24xx_create_vhost(struct fc_vport *fc_vport)
return(NULL); return(NULL);
} }
vha = (scsi_qla_host_t *)host->hostdata; vha = shost_priv(host);
/* clone the parent hba */ /* clone the parent hba */
memcpy(vha, ha, sizeof (scsi_qla_host_t)); memcpy(vha, ha, sizeof (scsi_qla_host_t));
......
...@@ -379,7 +379,7 @@ qla2x00_get_new_sp(scsi_qla_host_t *ha, fc_port_t *fcport, ...@@ -379,7 +379,7 @@ qla2x00_get_new_sp(scsi_qla_host_t *ha, fc_port_t *fcport,
static int static int
qla2x00_queuecommand(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)) qla2x00_queuecommand(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *))
{ {
scsi_qla_host_t *ha = to_qla_host(cmd->device->host); scsi_qla_host_t *ha = shost_priv(cmd->device->host);
fc_port_t *fcport = (struct fc_port *) cmd->device->hostdata; fc_port_t *fcport = (struct fc_port *) cmd->device->hostdata;
struct fc_rport *rport = starget_to_rport(scsi_target(cmd->device)); struct fc_rport *rport = starget_to_rport(scsi_target(cmd->device));
srb_t *sp; srb_t *sp;
...@@ -445,7 +445,7 @@ qla2x00_queuecommand(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)) ...@@ -445,7 +445,7 @@ qla2x00_queuecommand(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *))
static int static int
qla24xx_queuecommand(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)) qla24xx_queuecommand(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *))
{ {
scsi_qla_host_t *ha = to_qla_host(cmd->device->host); scsi_qla_host_t *ha = shost_priv(cmd->device->host);
fc_port_t *fcport = (struct fc_port *) cmd->device->hostdata; fc_port_t *fcport = (struct fc_port *) cmd->device->hostdata;
struct fc_rport *rport = starget_to_rport(scsi_target(cmd->device)); struct fc_rport *rport = starget_to_rport(scsi_target(cmd->device));
srb_t *sp; srb_t *sp;
...@@ -663,7 +663,7 @@ qla2x00_block_error_handler(struct scsi_cmnd *cmnd) ...@@ -663,7 +663,7 @@ qla2x00_block_error_handler(struct scsi_cmnd *cmnd)
static int static int
qla2xxx_eh_abort(struct scsi_cmnd *cmd) qla2xxx_eh_abort(struct scsi_cmnd *cmd)
{ {
scsi_qla_host_t *ha = to_qla_host(cmd->device->host); scsi_qla_host_t *ha = shost_priv(cmd->device->host);
srb_t *sp; srb_t *sp;
int ret, i; int ret, i;
unsigned int id, lun; unsigned int id, lun;
...@@ -803,7 +803,7 @@ qla2x00_eh_wait_for_pending_target_commands(scsi_qla_host_t *ha, unsigned int t) ...@@ -803,7 +803,7 @@ qla2x00_eh_wait_for_pending_target_commands(scsi_qla_host_t *ha, unsigned int t)
static int static int
qla2xxx_eh_device_reset(struct scsi_cmnd *cmd) qla2xxx_eh_device_reset(struct scsi_cmnd *cmd)
{ {
scsi_qla_host_t *ha = to_qla_host(cmd->device->host); scsi_qla_host_t *ha = shost_priv(cmd->device->host);
fc_port_t *fcport = (struct fc_port *) cmd->device->hostdata; fc_port_t *fcport = (struct fc_port *) cmd->device->hostdata;
int ret = FAILED; int ret = FAILED;
unsigned int id, lun; unsigned int id, lun;
...@@ -932,7 +932,7 @@ qla2x00_eh_wait_for_pending_commands(scsi_qla_host_t *ha) ...@@ -932,7 +932,7 @@ qla2x00_eh_wait_for_pending_commands(scsi_qla_host_t *ha)
static int static int
qla2xxx_eh_bus_reset(struct scsi_cmnd *cmd) qla2xxx_eh_bus_reset(struct scsi_cmnd *cmd)
{ {
scsi_qla_host_t *ha = to_qla_host(cmd->device->host); scsi_qla_host_t *ha = shost_priv(cmd->device->host);
scsi_qla_host_t *pha = to_qla_parent(ha); scsi_qla_host_t *pha = to_qla_parent(ha);
fc_port_t *fcport = (struct fc_port *) cmd->device->hostdata; fc_port_t *fcport = (struct fc_port *) cmd->device->hostdata;
int ret = FAILED; int ret = FAILED;
...@@ -992,7 +992,7 @@ qla2xxx_eh_bus_reset(struct scsi_cmnd *cmd) ...@@ -992,7 +992,7 @@ qla2xxx_eh_bus_reset(struct scsi_cmnd *cmd)
static int static int
qla2xxx_eh_host_reset(struct scsi_cmnd *cmd) qla2xxx_eh_host_reset(struct scsi_cmnd *cmd)
{ {
scsi_qla_host_t *ha = to_qla_host(cmd->device->host); scsi_qla_host_t *ha = shost_priv(cmd->device->host);
fc_port_t *fcport = (struct fc_port *) cmd->device->hostdata; fc_port_t *fcport = (struct fc_port *) cmd->device->hostdata;
int ret = FAILED; int ret = FAILED;
unsigned int id, lun; unsigned int id, lun;
...@@ -1142,7 +1142,7 @@ qla2xxx_slave_alloc(struct scsi_device *sdev) ...@@ -1142,7 +1142,7 @@ qla2xxx_slave_alloc(struct scsi_device *sdev)
static int static int
qla2xxx_slave_configure(struct scsi_device *sdev) qla2xxx_slave_configure(struct scsi_device *sdev)
{ {
scsi_qla_host_t *ha = to_qla_host(sdev->host); scsi_qla_host_t *ha = shost_priv(sdev->host);
struct fc_rport *rport = starget_to_rport(sdev->sdev_target); struct fc_rport *rport = starget_to_rport(sdev->sdev_target);
if (sdev->tagged_supported) if (sdev->tagged_supported)
...@@ -1543,7 +1543,7 @@ qla2x00_iospace_config(scsi_qla_host_t *ha) ...@@ -1543,7 +1543,7 @@ qla2x00_iospace_config(scsi_qla_host_t *ha)
static void static void
qla2xxx_scan_start(struct Scsi_Host *shost) qla2xxx_scan_start(struct Scsi_Host *shost)
{ {
scsi_qla_host_t *ha = (scsi_qla_host_t *)shost->hostdata; scsi_qla_host_t *ha = shost_priv(shost);
set_bit(LOOP_RESYNC_NEEDED, &ha->dpc_flags); set_bit(LOOP_RESYNC_NEEDED, &ha->dpc_flags);
set_bit(LOCAL_LOOP_UPDATE, &ha->dpc_flags); set_bit(LOCAL_LOOP_UPDATE, &ha->dpc_flags);
...@@ -1553,7 +1553,7 @@ qla2xxx_scan_start(struct Scsi_Host *shost) ...@@ -1553,7 +1553,7 @@ qla2xxx_scan_start(struct Scsi_Host *shost)
static int static int
qla2xxx_scan_finished(struct Scsi_Host *shost, unsigned long time) qla2xxx_scan_finished(struct Scsi_Host *shost, unsigned long time)
{ {
scsi_qla_host_t *ha = (scsi_qla_host_t *)shost->hostdata; scsi_qla_host_t *ha = shost_priv(shost);
if (!ha->host) if (!ha->host)
return 1; return 1;
...@@ -1600,7 +1600,7 @@ qla2x00_probe_one(struct pci_dev *pdev, const struct pci_device_id *id) ...@@ -1600,7 +1600,7 @@ qla2x00_probe_one(struct pci_dev *pdev, const struct pci_device_id *id)
} }
/* Clear our data area */ /* Clear our data area */
ha = (scsi_qla_host_t *)host->hostdata; ha = shost_priv(host);
memset(ha, 0, sizeof(scsi_qla_host_t)); memset(ha, 0, sizeof(scsi_qla_host_t));
ha->pdev = pdev; ha->pdev = pdev;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment