Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 25799
b: refs/heads/master
c: 92aab64
h: refs/heads/master
i:
  25797: 18030db
  25795: 3191003
  25791: f951c8b
v: v3
  • Loading branch information
Mike Anderson authored and James Bottomley committed Apr 13, 2006
1 parent 3241c71 commit a8beb8e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 25 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: 9a72f976d29091e4f4dfa08ed404ef84a56b0d47
refs/heads/master: 92aab6464be735139f9ea38fd039c3b84c722630
30 changes: 6 additions & 24 deletions trunk/drivers/scsi/scsi_transport_sas.c
Original file line number Diff line number Diff line change
Expand Up @@ -406,8 +406,6 @@ struct sas_phy *sas_phy_alloc(struct device *parent, int number)
if (!phy)
return NULL;

get_device(parent);

phy->number = number;

device_initialize(&phy->dev);
Expand Down Expand Up @@ -459,10 +457,7 @@ EXPORT_SYMBOL(sas_phy_add);
void sas_phy_free(struct sas_phy *phy)
{
transport_destroy_device(&phy->dev);
put_device(phy->dev.parent);
put_device(phy->dev.parent);
put_device(phy->dev.parent);
kfree(phy);
put_device(&phy->dev);
}
EXPORT_SYMBOL(sas_phy_free);

Expand All @@ -484,7 +479,7 @@ sas_phy_delete(struct sas_phy *phy)
transport_remove_device(dev);
device_del(dev);
transport_destroy_device(dev);
put_device(dev->parent);
put_device(dev);
}
EXPORT_SYMBOL(sas_phy_delete);

Expand Down Expand Up @@ -800,7 +795,6 @@ struct sas_rphy *sas_end_device_alloc(struct sas_phy *parent)

rdev = kzalloc(sizeof(*rdev), GFP_KERNEL);
if (!rdev) {
put_device(&parent->dev);
return NULL;
}

Expand Down Expand Up @@ -836,7 +830,6 @@ struct sas_rphy *sas_expander_alloc(struct sas_phy *parent,

rdev = kzalloc(sizeof(*rdev), GFP_KERNEL);
if (!rdev) {
put_device(&parent->dev);
return NULL;
}

Expand Down Expand Up @@ -910,28 +903,17 @@ EXPORT_SYMBOL(sas_rphy_add);
*/
void sas_rphy_free(struct sas_rphy *rphy)
{
struct device *dev = &rphy->dev;
struct Scsi_Host *shost = dev_to_shost(rphy->dev.parent->parent);
struct sas_host_attrs *sas_host = to_sas_host_attrs(shost);

mutex_lock(&sas_host->lock);
list_del(&rphy->list);
mutex_unlock(&sas_host->lock);

transport_destroy_device(&rphy->dev);
put_device(rphy->dev.parent);
put_device(rphy->dev.parent);
put_device(rphy->dev.parent);
if (rphy->identify.device_type == SAS_END_DEVICE) {
struct sas_end_device *edev = rphy_to_end_device(rphy);

kfree(edev);
} else {
/* must be expander */
struct sas_expander_device *edev =
rphy_to_expander_device(rphy);
transport_destroy_device(dev);

kfree(edev);
}
put_device(dev);
}
EXPORT_SYMBOL(sas_rphy_free);

Expand Down Expand Up @@ -971,7 +953,7 @@ sas_rphy_delete(struct sas_rphy *rphy)

parent->rphy = NULL;

put_device(&parent->dev);
put_device(dev);
}
EXPORT_SYMBOL(sas_rphy_delete);

Expand Down

0 comments on commit a8beb8e

Please sign in to comment.