Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 47724
b: refs/heads/master
c: 8880839
h: refs/heads/master
v: v3
  • Loading branch information
Darrick J. Wong authored and James Bottomley committed Jan 13, 2007
1 parent ad8d6b3 commit 8693a70
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: befede3dabd204e9c546cbfbe391b29286c57da2
refs/heads/master: 8880839815265ccc0edaff52ba08d750eea57acb
39 changes: 33 additions & 6 deletions trunk/drivers/scsi/libsas/sas_discover.c
Original file line number Diff line number Diff line change
Expand Up @@ -548,7 +548,7 @@ int sas_discover_sata(struct domain_device *dev)

res = sas_notify_lldd_dev_found(dev);
if (res)
return res;
goto out_err2;

switch (dev->dev_type) {
case SATA_DEV:
Expand All @@ -560,11 +560,25 @@ int sas_discover_sata(struct domain_device *dev)
default:
break;
}
if (res)
goto out_err;

sas_notify_lldd_dev_gone(dev);
if (!res) {
sas_notify_lldd_dev_found(dev);
}
res = sas_notify_lldd_dev_found(dev);
if (res)
goto out_err2;

res = sas_rphy_add(dev->rphy);
if (res)
goto out_err;

return res;

out_err:
sas_notify_lldd_dev_gone(dev);
out_err2:
sas_rphy_free(dev->rphy);
dev->rphy = NULL;
return res;
}

Expand All @@ -580,7 +594,7 @@ int sas_discover_end_dev(struct domain_device *dev)

res = sas_notify_lldd_dev_found(dev);
if (res)
return res;
goto out_err2;

res = sas_rphy_add(dev->rphy);
if (res)
Expand All @@ -589,12 +603,21 @@ int sas_discover_end_dev(struct domain_device *dev)
/* do this to get the end device port attributes which will have
* been scanned in sas_rphy_add */
sas_notify_lldd_dev_gone(dev);
sas_notify_lldd_dev_found(dev);
res = sas_notify_lldd_dev_found(dev);
if (res)
goto out_err3;

return 0;

out_err:
sas_notify_lldd_dev_gone(dev);
out_err2:
sas_rphy_free(dev->rphy);
dev->rphy = NULL;
return res;
out_err3:
sas_rphy_delete(dev->rphy);
dev->rphy = NULL;
return res;
}

Expand Down Expand Up @@ -686,6 +709,10 @@ static void sas_discover_domain(struct work_struct *work)
}

if (error) {
spin_lock(&port->dev_list_lock);
list_del_init(&port->port_dev->dev_list_node);
spin_unlock(&port->dev_list_lock);

kfree(port->port_dev); /* not kobject_register-ed yet */
port->port_dev = NULL;
}
Expand Down

0 comments on commit 8693a70

Please sign in to comment.