Skip to content

Commit

Permalink
[PATCH] libata: Move ata_probe_ent_alloc to libata_core
Browse files Browse the repository at this point in the history
Move ata_probe_ent_alloc to libata-core. It will also be used by
future SAS/SATA integration patches.

Signed-off-by: Brian King <brking@us.ibm.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
  • Loading branch information
Brian King authored and Jeff Garzik committed Aug 9, 2006
1 parent 155a8a9 commit f6d950e
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 26 deletions.
26 changes: 0 additions & 26 deletions drivers/scsi/libata-bmdma.c
Original file line number Diff line number Diff line change
Expand Up @@ -797,32 +797,6 @@ void ata_bmdma_post_internal_cmd(struct ata_queued_cmd *qc)
}

#ifdef CONFIG_PCI
static struct ata_probe_ent *
ata_probe_ent_alloc(struct device *dev, const struct ata_port_info *port)
{
struct ata_probe_ent *probe_ent;

probe_ent = kzalloc(sizeof(*probe_ent), GFP_KERNEL);
if (!probe_ent) {
printk(KERN_ERR DRV_NAME "(%s): out of memory\n",
kobject_name(&(dev->kobj)));
return NULL;
}

INIT_LIST_HEAD(&probe_ent->node);
probe_ent->dev = dev;

probe_ent->sht = port->sht;
probe_ent->host_flags = port->host_flags;
probe_ent->pio_mask = port->pio_mask;
probe_ent->mwdma_mask = port->mwdma_mask;
probe_ent->udma_mask = port->udma_mask;
probe_ent->port_ops = port->port_ops;

return probe_ent;
}


/**
* ata_pci_init_native_mode - Initialize native-mode driver
* @pdev: pci device to be initialized
Expand Down
25 changes: 25 additions & 0 deletions drivers/scsi/libata-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -5688,6 +5688,31 @@ int ata_scsi_release(struct Scsi_Host *host)
return 1;
}

struct ata_probe_ent *
ata_probe_ent_alloc(struct device *dev, const struct ata_port_info *port)
{
struct ata_probe_ent *probe_ent;

probe_ent = kzalloc(sizeof(*probe_ent), GFP_KERNEL);
if (!probe_ent) {
printk(KERN_ERR DRV_NAME "(%s): out of memory\n",
kobject_name(&(dev->kobj)));
return NULL;
}

INIT_LIST_HEAD(&probe_ent->node);
probe_ent->dev = dev;

probe_ent->sht = port->sht;
probe_ent->host_flags = port->host_flags;
probe_ent->pio_mask = port->pio_mask;
probe_ent->mwdma_mask = port->mwdma_mask;
probe_ent->udma_mask = port->udma_mask;
probe_ent->port_ops = port->port_ops;

return probe_ent;
}

/**
* ata_std_ports - initialize ioaddr with standard port offsets.
* @ioaddr: IO address structure to be initialized
Expand Down
2 changes: 2 additions & 0 deletions drivers/scsi/libata.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ extern int ata_task_ioctl(struct scsi_device *scsidev, void __user *arg);
extern int ata_cmd_ioctl(struct scsi_device *scsidev, void __user *arg);
extern void ata_port_init(struct ata_port *ap, struct ata_host_set *host_set,
const struct ata_probe_ent *ent, unsigned int port_no);
extern struct ata_probe_ent *ata_probe_ent_alloc(struct device *dev,
const struct ata_port_info *port);


/* libata-scsi.c */
Expand Down

0 comments on commit f6d950e

Please sign in to comment.