diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2008-07-02 21:57:33 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-07-02 21:57:33 -0400 |
commit | f36b7a2c170ff1dbbb38d235817e04020b196950 (patch) | |
tree | 13b97589aa79ff615c85d42b09a29effd59f33a2 | |
parent | cefcade9e7b2331110fdd709b5871ebcc5f9a40f (diff) | |
parent | ec5e69f6d3f4350681d6f7eaae515cf014be9276 (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-rc-fixes-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-rc-fixes-2.6:
[SCSI] esp: tidy up target reference counting
[SCSI] esp: Fix OOPS in esp_reset_cleanup().
[SCSI] ses: Fix timeout
-rw-r--r-- | drivers/scsi/esp_scsi.c | 22 | ||||
-rw-r--r-- | drivers/scsi/ses.c | 2 |
2 files changed, 21 insertions, 3 deletions
diff --git a/drivers/scsi/esp_scsi.c b/drivers/scsi/esp_scsi.c index a0b6d414953d..59fbef08d690 100644 --- a/drivers/scsi/esp_scsi.c +++ b/drivers/scsi/esp_scsi.c | |||
@@ -2359,6 +2359,24 @@ void scsi_esp_unregister(struct esp *esp) | |||
2359 | } | 2359 | } |
2360 | EXPORT_SYMBOL(scsi_esp_unregister); | 2360 | EXPORT_SYMBOL(scsi_esp_unregister); |
2361 | 2361 | ||
2362 | static int esp_target_alloc(struct scsi_target *starget) | ||
2363 | { | ||
2364 | struct esp *esp = shost_priv(dev_to_shost(&starget->dev)); | ||
2365 | struct esp_target_data *tp = &esp->target[starget->id]; | ||
2366 | |||
2367 | tp->starget = starget; | ||
2368 | |||
2369 | return 0; | ||
2370 | } | ||
2371 | |||
2372 | static void esp_target_destroy(struct scsi_target *starget) | ||
2373 | { | ||
2374 | struct esp *esp = shost_priv(dev_to_shost(&starget->dev)); | ||
2375 | struct esp_target_data *tp = &esp->target[starget->id]; | ||
2376 | |||
2377 | tp->starget = NULL; | ||
2378 | } | ||
2379 | |||
2362 | static int esp_slave_alloc(struct scsi_device *dev) | 2380 | static int esp_slave_alloc(struct scsi_device *dev) |
2363 | { | 2381 | { |
2364 | struct esp *esp = shost_priv(dev->host); | 2382 | struct esp *esp = shost_priv(dev->host); |
@@ -2370,8 +2388,6 @@ static int esp_slave_alloc(struct scsi_device *dev) | |||
2370 | return -ENOMEM; | 2388 | return -ENOMEM; |
2371 | dev->hostdata = lp; | 2389 | dev->hostdata = lp; |
2372 | 2390 | ||
2373 | tp->starget = dev->sdev_target; | ||
2374 | |||
2375 | spi_min_period(tp->starget) = esp->min_period; | 2391 | spi_min_period(tp->starget) = esp->min_period; |
2376 | spi_max_offset(tp->starget) = 15; | 2392 | spi_max_offset(tp->starget) = 15; |
2377 | 2393 | ||
@@ -2608,6 +2624,8 @@ struct scsi_host_template scsi_esp_template = { | |||
2608 | .name = "esp", | 2624 | .name = "esp", |
2609 | .info = esp_info, | 2625 | .info = esp_info, |
2610 | .queuecommand = esp_queuecommand, | 2626 | .queuecommand = esp_queuecommand, |
2627 | .target_alloc = esp_target_alloc, | ||
2628 | .target_destroy = esp_target_destroy, | ||
2611 | .slave_alloc = esp_slave_alloc, | 2629 | .slave_alloc = esp_slave_alloc, |
2612 | .slave_configure = esp_slave_configure, | 2630 | .slave_configure = esp_slave_configure, |
2613 | .slave_destroy = esp_slave_destroy, | 2631 | .slave_destroy = esp_slave_destroy, |
diff --git a/drivers/scsi/ses.c b/drivers/scsi/ses.c index 45df83b9d847..0fe031f003e7 100644 --- a/drivers/scsi/ses.c +++ b/drivers/scsi/ses.c | |||
@@ -61,7 +61,7 @@ static int ses_probe(struct device *dev) | |||
61 | return err; | 61 | return err; |
62 | } | 62 | } |
63 | 63 | ||
64 | #define SES_TIMEOUT 30 | 64 | #define SES_TIMEOUT (30 * HZ) |
65 | #define SES_RETRIES 3 | 65 | #define SES_RETRIES 3 |
66 | 66 | ||
67 | static int ses_recv_diag(struct scsi_device *sdev, int page_code, | 67 | static int ses_recv_diag(struct scsi_device *sdev, int page_code, |