diff options
author | Matthew Wilcox <matthew@wil.cx> | 2007-07-17 13:38:03 -0600 |
---|---|---|
committer | James Bottomley <jejb@mulgrave.localdomain> | 2007-07-18 11:17:57 -0500 |
commit | 3ac709c113daa19e375e8b0fef318fab1713f687 (patch) | |
tree | 210b4b746f02197ac8c48dbcd424cbc716a7ae22 /drivers/scsi/sim710.c | |
parent | 88e2f98e1b3eb27ae708daa3b37dd50f3f06c952 (diff) | |
download | linux-3.10-3ac709c113daa19e375e8b0fef318fab1713f687.tar.gz linux-3.10-3ac709c113daa19e375e8b0fef318fab1713f687.tar.bz2 linux-3.10-3ac709c113daa19e375e8b0fef318fab1713f687.zip |
[SCSI] a4000t, zorro7xx, mvme16x, bvme6000,sim710: xxx_device_remove seems buggy
Fix drivers misusing dev_to_shost
Some drivers were using dev_to_shost to go from a struct device to the
corresponding shost. Unfortunately, dev_to_shost only looks up the tree
to find an shost (it's designed to go from a scsi_device or a
scsi_target to the parent scsi_host), and these drivers were calling it
with the parent of the scsi_host.
I've fixed this by saving a pointer to the Scsi_Host in the drvdata,
which matches what most scsi drivers do.
Signed-off-by: Matthew Wilcox <matthew@wil.cx>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/scsi/sim710.c')
-rw-r--r-- | drivers/scsi/sim710.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/scsi/sim710.c b/drivers/scsi/sim710.c index 018c65f73ac..6ab11b487ec 100644 --- a/drivers/scsi/sim710.c +++ b/drivers/scsi/sim710.c @@ -139,6 +139,7 @@ sim710_probe_common(struct device *dev, unsigned long base_addr, goto out_put_host; } + dev_set_drvdata(dev, host); scsi_scan_host(host); return 0; @@ -156,7 +157,7 @@ sim710_probe_common(struct device *dev, unsigned long base_addr, static __devexit int sim710_device_remove(struct device *dev) { - struct Scsi_Host *host = dev_to_shost(dev); + struct Scsi_Host *host = dev_get_drvdata(dev); struct NCR_700_Host_Parameters *hostdata = (struct NCR_700_Host_Parameters *)host->hostdata[0]; |