diff options
Diffstat (limited to 'drivers/scsi/cxgb3i/cxgb3i_iscsi.c')
-rw-r--r-- | drivers/scsi/cxgb3i/cxgb3i_iscsi.c | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/drivers/scsi/cxgb3i/cxgb3i_iscsi.c b/drivers/scsi/cxgb3i/cxgb3i_iscsi.c index 969c83162cc4..412853c65372 100644 --- a/drivers/scsi/cxgb3i/cxgb3i_iscsi.c +++ b/drivers/scsi/cxgb3i/cxgb3i_iscsi.c | |||
@@ -591,8 +591,7 @@ static int cxgb3i_conn_bind(struct iscsi_cls_session *cls_session, | |||
591 | cxgb3i_conn_max_recv_dlength(conn); | 591 | cxgb3i_conn_max_recv_dlength(conn); |
592 | 592 | ||
593 | spin_lock_bh(&conn->session->lock); | 593 | spin_lock_bh(&conn->session->lock); |
594 | sprintf(conn->portal_address, NIPQUAD_FMT, | 594 | sprintf(conn->portal_address, "%pI4", &c3cn->daddr.sin_addr.s_addr); |
595 | NIPQUAD(c3cn->daddr.sin_addr.s_addr)); | ||
596 | conn->portal_port = ntohs(c3cn->daddr.sin_port); | 595 | conn->portal_port = ntohs(c3cn->daddr.sin_port); |
597 | spin_unlock_bh(&conn->session->lock); | 596 | spin_unlock_bh(&conn->session->lock); |
598 | 597 | ||
@@ -709,6 +708,12 @@ static int cxgb3i_host_set_param(struct Scsi_Host *shost, | |||
709 | { | 708 | { |
710 | struct cxgb3i_hba *hba = iscsi_host_priv(shost); | 709 | struct cxgb3i_hba *hba = iscsi_host_priv(shost); |
711 | 710 | ||
711 | if (!hba->ndev) { | ||
712 | shost_printk(KERN_ERR, shost, "Could not set host param. " | ||
713 | "Netdev for host not set.\n"); | ||
714 | return -ENODEV; | ||
715 | } | ||
716 | |||
712 | cxgb3i_api_debug("param %d, buf %s.\n", param, buf); | 717 | cxgb3i_api_debug("param %d, buf %s.\n", param, buf); |
713 | 718 | ||
714 | switch (param) { | 719 | switch (param) { |
@@ -739,6 +744,12 @@ static int cxgb3i_host_get_param(struct Scsi_Host *shost, | |||
739 | struct cxgb3i_hba *hba = iscsi_host_priv(shost); | 744 | struct cxgb3i_hba *hba = iscsi_host_priv(shost); |
740 | int len = 0; | 745 | int len = 0; |
741 | 746 | ||
747 | if (!hba->ndev) { | ||
748 | shost_printk(KERN_ERR, shost, "Could not set host param. " | ||
749 | "Netdev for host not set.\n"); | ||
750 | return -ENODEV; | ||
751 | } | ||
752 | |||
742 | cxgb3i_api_debug("hba %s, param %d.\n", hba->ndev->name, param); | 753 | cxgb3i_api_debug("hba %s, param %d.\n", hba->ndev->name, param); |
743 | 754 | ||
744 | switch (param) { | 755 | switch (param) { |
@@ -753,7 +764,7 @@ static int cxgb3i_host_get_param(struct Scsi_Host *shost, | |||
753 | __be32 addr; | 764 | __be32 addr; |
754 | 765 | ||
755 | addr = cxgb3i_get_private_ipv4addr(hba->ndev); | 766 | addr = cxgb3i_get_private_ipv4addr(hba->ndev); |
756 | len = sprintf(buf, NIPQUAD_FMT, NIPQUAD(addr)); | 767 | len = sprintf(buf, "%pI4", &addr); |
757 | break; | 768 | break; |
758 | } | 769 | } |
759 | default: | 770 | default: |