aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/scsi/libata-core.c28
-rw-r--r--include/linux/libata.h2
2 files changed, 26 insertions, 4 deletions
diff --git a/drivers/scsi/libata-core.c b/drivers/scsi/libata-core.c
index 351544d3653a..886440b128a5 100644
--- a/drivers/scsi/libata-core.c
+++ b/drivers/scsi/libata-core.c
@@ -5351,6 +5351,28 @@ err_out:
5351} 5351}
5352 5352
5353/** 5353/**
5354 * ata_sas_host_init - Initialize a host_set struct
5355 * @host_set: host_set to initialize
5356 * @dev: device host_set is attached to
5357 * @flags: host_set flags
5358 * @ops: port_ops
5359 *
5360 * LOCKING:
5361 * PCI/etc. bus probe sem.
5362 *
5363 */
5364
5365void ata_host_set_init(struct ata_host_set *host_set,
5366 struct device *dev, unsigned long flags,
5367 const struct ata_port_operations *ops)
5368{
5369 spin_lock_init(&host_set->lock);
5370 host_set->dev = dev;
5371 host_set->flags = flags;
5372 host_set->ops = ops;
5373}
5374
5375/**
5354 * ata_device_add - Register hardware device with ATA and SCSI layers 5376 * ata_device_add - Register hardware device with ATA and SCSI layers
5355 * @ent: Probe information describing hardware device to be registered 5377 * @ent: Probe information describing hardware device to be registered
5356 * 5378 *
@@ -5381,15 +5403,12 @@ int ata_device_add(const struct ata_probe_ent *ent)
5381 (ent->n_ports * sizeof(void *)), GFP_KERNEL); 5403 (ent->n_ports * sizeof(void *)), GFP_KERNEL);
5382 if (!host_set) 5404 if (!host_set)
5383 return 0; 5405 return 0;
5384 spin_lock_init(&host_set->lock);
5385 5406
5386 host_set->dev = dev; 5407 ata_host_set_init(host_set, dev, ent->host_set_flags, ent->port_ops);
5387 host_set->n_ports = ent->n_ports; 5408 host_set->n_ports = ent->n_ports;
5388 host_set->irq = ent->irq; 5409 host_set->irq = ent->irq;
5389 host_set->mmio_base = ent->mmio_base; 5410 host_set->mmio_base = ent->mmio_base;
5390 host_set->private_data = ent->private_data; 5411 host_set->private_data = ent->private_data;
5391 host_set->ops = ent->port_ops;
5392 host_set->flags = ent->host_set_flags;
5393 5412
5394 /* register each port bound to this device */ 5413 /* register each port bound to this device */
5395 for (i = 0; i < ent->n_ports; i++) { 5414 for (i = 0; i < ent->n_ports; i++) {
@@ -5908,6 +5927,7 @@ EXPORT_SYMBOL_GPL(sata_deb_timing_hotplug);
5908EXPORT_SYMBOL_GPL(sata_deb_timing_long); 5927EXPORT_SYMBOL_GPL(sata_deb_timing_long);
5909EXPORT_SYMBOL_GPL(ata_std_bios_param); 5928EXPORT_SYMBOL_GPL(ata_std_bios_param);
5910EXPORT_SYMBOL_GPL(ata_std_ports); 5929EXPORT_SYMBOL_GPL(ata_std_ports);
5930EXPORT_SYMBOL_GPL(ata_host_set_init);
5911EXPORT_SYMBOL_GPL(ata_device_add); 5931EXPORT_SYMBOL_GPL(ata_device_add);
5912EXPORT_SYMBOL_GPL(ata_port_detach); 5932EXPORT_SYMBOL_GPL(ata_port_detach);
5913EXPORT_SYMBOL_GPL(ata_host_set_remove); 5933EXPORT_SYMBOL_GPL(ata_host_set_remove);
diff --git a/include/linux/libata.h b/include/linux/libata.h
index b9416708bba2..be15ef5d8d85 100644
--- a/include/linux/libata.h
+++ b/include/linux/libata.h
@@ -684,6 +684,8 @@ extern int ata_pci_clear_simplex(struct pci_dev *pdev);
684#endif /* CONFIG_PCI */ 684#endif /* CONFIG_PCI */
685extern int ata_device_add(const struct ata_probe_ent *ent); 685extern int ata_device_add(const struct ata_probe_ent *ent);
686extern void ata_port_detach(struct ata_port *ap); 686extern void ata_port_detach(struct ata_port *ap);
687extern void ata_host_set_init(struct ata_host_set *, struct device *,
688 unsigned long, const struct ata_port_operations *);
687extern void ata_host_set_remove(struct ata_host_set *host_set); 689extern void ata_host_set_remove(struct ata_host_set *host_set);
688extern int ata_scsi_detect(struct scsi_host_template *sht); 690extern int ata_scsi_detect(struct scsi_host_template *sht);
689extern int ata_scsi_ioctl(struct scsi_device *dev, int cmd, void __user *arg); 691extern int ata_scsi_ioctl(struct scsi_device *dev, int cmd, void __user *arg);