24 #include <linux/module.h>
26 #include <linux/kernel.h>
27 #include <linux/slab.h>
29 #include <linux/string.h>
48 static void scsi_host_cls_release(
struct device *
dev)
53 static struct class shost_class = {
55 .dev_release = scsi_host_cls_release,
70 if (state == oldstate)
145 "Illegal host state transition"
165 spin_unlock_irqrestore(shost->
host_lock, flags);
169 spin_unlock_irqrestore(shost->
host_lock, flags);
171 scsi_autopm_get_host(shost);
179 spin_unlock_irqrestore(shost->
host_lock, flags);
181 transport_unregister_device(&shost->shost_gendev);
219 if (!shost->shost_gendev.parent)
222 dma_dev = shost->shost_gendev.parent;
230 pm_runtime_set_active(&shost->shost_gendev);
232 device_enable_async_suspend(&shost->shost_gendev);
237 device_enable_async_suspend(&shost->
shost_dev);
261 goto out_free_shost_data;
267 goto out_destroy_host;
288 static void scsi_host_dev_release(
struct device *dev)
303 queuedata = q->queuedata;
321 .release = scsi_host_dev_release,
345 shost = kzalloc(
sizeof(
struct Scsi_Host) + privsize, gfp_mask);
423 shost->shost_gendev.type = &scsi_host_type;
426 shost->
shost_dev.parent = &shost->shost_gendev;
454 "template for driver %s\n", sht->
name);
471 static int __scsi_host_match(
struct device *dev,
void *
data)
474 unsigned short *hostnum = (
unsigned short *)data;
541 return dev->
type == &scsi_host_type;
559 "ERROR: Scsi host '%s' attempted to queue scsi-work, "
560 "when no workqueue created.\n", shost->
hostt->name);
578 "ERROR: Scsi host '%s' attempted to flush scsi-work, "
579 "when no workqueue created.\n", shost->
hostt->name);