]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - drivers/scsi/libsas/sas_port.c
Merge git://git.kernel.org/pub/scm/linux/kernel/git/cmetcalf/linux-tile
[karo-tx-linux.git] / drivers / scsi / libsas / sas_port.c
index 59ee8a0a6ea958aaf0026336fdcb717d285aafee..eb19c016d5001b1890feafa0f8ae140e1982a1bf 100644 (file)
@@ -104,6 +104,7 @@ static void sas_form_port(struct asd_sas_phy *phy)
 
        /* add the phy to the port */
        list_add_tail(&phy->port_phy_el, &port->phy_list);
+       sas_phy_set_target(phy, port->port_dev);
        phy->port = port;
        port->num_phys++;
        port->phy_mask |= (1U << phy->id);
@@ -122,7 +123,7 @@ static void sas_form_port(struct asd_sas_phy *phy)
        spin_unlock_irqrestore(&sas_ha->phy_port_lock, flags);
 
        if (!port->port) {
-               port->port = sas_port_alloc(phy->phy->dev.parent, port->id);
+               port->port = sas_port_alloc(phy->phy->dev.parent, phy->id);
                BUG_ON(!port->port);
                sas_port_add(port->port);
        }
@@ -182,6 +183,7 @@ void sas_deform_port(struct asd_sas_phy *phy, int gone)
        spin_lock(&port->phy_list_lock);
 
        list_del_init(&phy->port_phy_el);
+       sas_phy_set_target(phy, NULL);
        phy->port = NULL;
        port->num_phys--;
        port->phy_mask &= ~(1U << phy->id);