Commit b391277a56b9eaaff4474339c703e574ed7fab5b
Committed by
James Bottomley
1 parent
24add1c432
Exists in
master
and in
39 other branches
sd, sr: fix Driver 'sd' needs updating message
If a SCSI ULD driver sets blk_queue_prep_rq(), it should clean it up itself on remove(), and not from the bus callbacks. This removes the need to hook into bus->remove(), which should not be used at the same time as driver->remove(). [jejb: fix sdkp initialisation problem due to mismerge] Signed-off-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Kay Sievers <kay.sievers@vrfy.org> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Showing 6 changed files with 4 additions and 18 deletions Side-by-side Diff
drivers/scsi/scsi_lib.c
drivers/scsi/scsi_priv.h
drivers/scsi/scsi_sysfs.c
... | ... | @@ -420,29 +420,12 @@ |
420 | 420 | return err; |
421 | 421 | } |
422 | 422 | |
423 | -static int scsi_bus_remove(struct device *dev) | |
424 | -{ | |
425 | - struct device_driver *drv = dev->driver; | |
426 | - struct scsi_device *sdev = to_scsi_device(dev); | |
427 | - int err = 0; | |
428 | - | |
429 | - /* reset the prep_fn back to the default since the | |
430 | - * driver may have altered it and it's being removed */ | |
431 | - blk_queue_prep_rq(sdev->request_queue, scsi_prep_fn); | |
432 | - | |
433 | - if (drv && drv->remove) | |
434 | - err = drv->remove(dev); | |
435 | - | |
436 | - return 0; | |
437 | -} | |
438 | - | |
439 | 423 | struct bus_type scsi_bus_type = { |
440 | 424 | .name = "scsi", |
441 | 425 | .match = scsi_bus_match, |
442 | 426 | .uevent = scsi_bus_uevent, |
443 | 427 | .suspend = scsi_bus_suspend, |
444 | 428 | .resume = scsi_bus_resume, |
445 | - .remove = scsi_bus_remove, | |
446 | 429 | }; |
447 | 430 | EXPORT_SYMBOL_GPL(scsi_bus_type); |
448 | 431 |
drivers/scsi/sd.c
drivers/scsi/sr.c
include/scsi/scsi_driver.h
... | ... | @@ -32,6 +32,7 @@ |
32 | 32 | int scsi_setup_fs_cmnd(struct scsi_device *sdev, struct request *req); |
33 | 33 | int scsi_prep_state_check(struct scsi_device *sdev, struct request *req); |
34 | 34 | int scsi_prep_return(struct request_queue *q, struct request *req, int ret); |
35 | +int scsi_prep_fn(struct request_queue *, struct request *); | |
35 | 36 | |
36 | 37 | #endif /* _SCSI_SCSI_DRIVER_H */ |