Merge tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi
[sfrench/cifs-2.6.git] / drivers / scsi / scsi_transport_sas.c
index a22baf206071558adeff5b1d22da62fab8aed425..0cd16e80b01956c8b4161635e7a5f489b1226668 100644 (file)
@@ -187,16 +187,6 @@ static int sas_smp_dispatch(struct bsg_job *job)
        return 0;
 }
 
-static void sas_host_release(struct device *dev)
-{
-       struct Scsi_Host *shost = dev_to_shost(dev);
-       struct sas_host_attrs *sas_host = to_sas_host_attrs(shost);
-       struct request_queue *q = sas_host->q;
-
-       if (q)
-               blk_cleanup_queue(q);
-}
-
 static int sas_bsg_initialize(struct Scsi_Host *shost, struct sas_rphy *rphy)
 {
        struct request_queue *q;
@@ -208,7 +198,7 @@ static int sas_bsg_initialize(struct Scsi_Host *shost, struct sas_rphy *rphy)
 
        if (rphy) {
                q = bsg_setup_queue(&rphy->dev, dev_name(&rphy->dev),
-                               sas_smp_dispatch, 0, NULL);
+                               sas_smp_dispatch, 0);
                if (IS_ERR(q))
                        return PTR_ERR(q);
                rphy->q = q;
@@ -217,7 +207,7 @@ static int sas_bsg_initialize(struct Scsi_Host *shost, struct sas_rphy *rphy)
 
                snprintf(name, sizeof(name), "sas_host%d", shost->host_no);
                q = bsg_setup_queue(&shost->shost_gendev, name,
-                               sas_smp_dispatch, 0, sas_host_release);
+                               sas_smp_dispatch, 0);
                if (IS_ERR(q))
                        return PTR_ERR(q);
                to_sas_host_attrs(shost)->q = q;
@@ -256,8 +246,11 @@ static int sas_host_remove(struct transport_container *tc, struct device *dev,
        struct Scsi_Host *shost = dev_to_shost(dev);
        struct request_queue *q = to_sas_host_attrs(shost)->q;
 
-       if (q)
+       if (q) {
                bsg_unregister_queue(q);
+               blk_cleanup_queue(q);
+       }
+
        return 0;
 }