Skip to content

Commit cca3974

Browse files
author
Jeff Garzik
committed
libata: Grand renaming.
The biggest change is that ata_host_set is renamed to ata_host. * ata_host_set => ata_host * ata_probe_ent->host_flags => ata_probe_ent->port_flags * ata_probe_ent->host_set_flags => ata_probe_ent->_host_flags * ata_host_stats => ata_port_stats * ata_port->host => ata_port->scsi_host * ata_port->host_set => ata_port->host * ata_port_info->host_flags => ata_port_info->flags * ata_(.*)host_set(.*)\(\) => ata_\1host\2() The leading underscore in ata_probe_ent->_host_flags is to avoid reusing ->host_flags for different purpose. Currently, the only user of the field is libata-bmdma.c and probe_ent itself is scheduled to be removed. ata_port->host is reused for different purpose but this field is used inside libata core proper and of different type. Signed-off-by: Tejun Heo <[email protected]> Signed-off-by: Jeff Garzik <[email protected]>
1 parent 54a86bf commit cca3974

21 files changed

+568
-573
lines changed

drivers/ata/ahci.c

Lines changed: 49 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ static const struct ata_port_info ahci_port_info[] = {
277277
/* board_ahci */
278278
{
279279
.sht = &ahci_sht,
280-
.host_flags = ATA_FLAG_SATA | ATA_FLAG_NO_LEGACY |
280+
.flags = ATA_FLAG_SATA | ATA_FLAG_NO_LEGACY |
281281
ATA_FLAG_MMIO | ATA_FLAG_PIO_DMA |
282282
ATA_FLAG_SKIP_D2H_BSY,
283283
.pio_mask = 0x1f, /* pio0-4 */
@@ -287,7 +287,7 @@ static const struct ata_port_info ahci_port_info[] = {
287287
/* board_ahci_vt8251 */
288288
{
289289
.sht = &ahci_sht,
290-
.host_flags = ATA_FLAG_SATA | ATA_FLAG_NO_LEGACY |
290+
.flags = ATA_FLAG_SATA | ATA_FLAG_NO_LEGACY |
291291
ATA_FLAG_MMIO | ATA_FLAG_PIO_DMA |
292292
ATA_FLAG_SKIP_D2H_BSY |
293293
AHCI_FLAG_RESET_NEEDS_CLO | AHCI_FLAG_NO_NCQ,
@@ -709,7 +709,7 @@ static void ahci_fill_cmd_slot(struct ahci_port_priv *pp, unsigned int tag,
709709
static int ahci_clo(struct ata_port *ap)
710710
{
711711
void __iomem *port_mmio = (void __iomem *) ap->ioaddr.cmd_addr;
712-
struct ahci_host_priv *hpriv = ap->host_set->private_data;
712+
struct ahci_host_priv *hpriv = ap->host->private_data;
713713
u32 tmp;
714714

715715
if (!(hpriv->cap & HOST_CAP_CLO))
@@ -741,7 +741,7 @@ static int ahci_prereset(struct ata_port *ap)
741741
static int ahci_softreset(struct ata_port *ap, unsigned int *class)
742742
{
743743
struct ahci_port_priv *pp = ap->private_data;
744-
void __iomem *mmio = ap->host_set->mmio_base;
744+
void __iomem *mmio = ap->host->mmio_base;
745745
void __iomem *port_mmio = ahci_port_base(mmio, ap->port_no);
746746
const u32 cmd_fis_len = 5; /* five dwords */
747747
const char *reason = NULL;
@@ -850,7 +850,7 @@ static int ahci_hardreset(struct ata_port *ap, unsigned int *class)
850850
struct ahci_port_priv *pp = ap->private_data;
851851
u8 *d2h_fis = pp->rx_fis + RX_FIS_D2H_REG;
852852
struct ata_taskfile tf;
853-
void __iomem *mmio = ap->host_set->mmio_base;
853+
void __iomem *mmio = ap->host->mmio_base;
854854
void __iomem *port_mmio = ahci_port_base(mmio, ap->port_no);
855855
int rc;
856856

@@ -1039,7 +1039,7 @@ static void ahci_error_intr(struct ata_port *ap, u32 irq_stat)
10391039

10401040
static void ahci_host_intr(struct ata_port *ap)
10411041
{
1042-
void __iomem *mmio = ap->host_set->mmio_base;
1042+
void __iomem *mmio = ap->host->mmio_base;
10431043
void __iomem *port_mmio = ahci_port_base(mmio, ap->port_no);
10441044
struct ata_eh_info *ehi = &ap->eh_info;
10451045
u32 status, qc_active;
@@ -1091,39 +1091,39 @@ static void ahci_irq_clear(struct ata_port *ap)
10911091

10921092
static irqreturn_t ahci_interrupt(int irq, void *dev_instance, struct pt_regs *regs)
10931093
{
1094-
struct ata_host_set *host_set = dev_instance;
1094+
struct ata_host *host = dev_instance;
10951095
struct ahci_host_priv *hpriv;
10961096
unsigned int i, handled = 0;
10971097
void __iomem *mmio;
10981098
u32 irq_stat, irq_ack = 0;
10991099

11001100
VPRINTK("ENTER\n");
11011101

1102-
hpriv = host_set->private_data;
1103-
mmio = host_set->mmio_base;
1102+
hpriv = host->private_data;
1103+
mmio = host->mmio_base;
11041104

11051105
/* sigh. 0xffffffff is a valid return from h/w */
11061106
irq_stat = readl(mmio + HOST_IRQ_STAT);
11071107
irq_stat &= hpriv->port_map;
11081108
if (!irq_stat)
11091109
return IRQ_NONE;
11101110

1111-
spin_lock(&host_set->lock);
1111+
spin_lock(&host->lock);
11121112

1113-
for (i = 0; i < host_set->n_ports; i++) {
1113+
for (i = 0; i < host->n_ports; i++) {
11141114
struct ata_port *ap;
11151115

11161116
if (!(irq_stat & (1 << i)))
11171117
continue;
11181118

1119-
ap = host_set->ports[i];
1119+
ap = host->ports[i];
11201120
if (ap) {
11211121
ahci_host_intr(ap);
11221122
VPRINTK("port %u\n", i);
11231123
} else {
11241124
VPRINTK("port %u (no irq)\n", i);
11251125
if (ata_ratelimit())
1126-
dev_printk(KERN_WARNING, host_set->dev,
1126+
dev_printk(KERN_WARNING, host->dev,
11271127
"interrupt on disabled port %u\n", i);
11281128
}
11291129

@@ -1135,7 +1135,7 @@ static irqreturn_t ahci_interrupt(int irq, void *dev_instance, struct pt_regs *r
11351135
handled = 1;
11361136
}
11371137

1138-
spin_unlock(&host_set->lock);
1138+
spin_unlock(&host->lock);
11391139

11401140
VPRINTK("EXIT\n");
11411141

@@ -1157,7 +1157,7 @@ static unsigned int ahci_qc_issue(struct ata_queued_cmd *qc)
11571157

11581158
static void ahci_freeze(struct ata_port *ap)
11591159
{
1160-
void __iomem *mmio = ap->host_set->mmio_base;
1160+
void __iomem *mmio = ap->host->mmio_base;
11611161
void __iomem *port_mmio = ahci_port_base(mmio, ap->port_no);
11621162

11631163
/* turn IRQ off */
@@ -1166,7 +1166,7 @@ static void ahci_freeze(struct ata_port *ap)
11661166

11671167
static void ahci_thaw(struct ata_port *ap)
11681168
{
1169-
void __iomem *mmio = ap->host_set->mmio_base;
1169+
void __iomem *mmio = ap->host->mmio_base;
11701170
void __iomem *port_mmio = ahci_port_base(mmio, ap->port_no);
11711171
u32 tmp;
11721172

@@ -1181,7 +1181,7 @@ static void ahci_thaw(struct ata_port *ap)
11811181

11821182
static void ahci_error_handler(struct ata_port *ap)
11831183
{
1184-
void __iomem *mmio = ap->host_set->mmio_base;
1184+
void __iomem *mmio = ap->host->mmio_base;
11851185
void __iomem *port_mmio = ahci_port_base(mmio, ap->port_no);
11861186

11871187
if (!(ap->pflags & ATA_PFLAG_FROZEN)) {
@@ -1198,7 +1198,7 @@ static void ahci_error_handler(struct ata_port *ap)
11981198
static void ahci_post_internal_cmd(struct ata_queued_cmd *qc)
11991199
{
12001200
struct ata_port *ap = qc->ap;
1201-
void __iomem *mmio = ap->host_set->mmio_base;
1201+
void __iomem *mmio = ap->host->mmio_base;
12021202
void __iomem *port_mmio = ahci_port_base(mmio, ap->port_no);
12031203

12041204
if (qc->flags & ATA_QCFLAG_FAILED)
@@ -1213,9 +1213,9 @@ static void ahci_post_internal_cmd(struct ata_queued_cmd *qc)
12131213

12141214
static int ahci_port_suspend(struct ata_port *ap, pm_message_t mesg)
12151215
{
1216-
struct ahci_host_priv *hpriv = ap->host_set->private_data;
1216+
struct ahci_host_priv *hpriv = ap->host->private_data;
12171217
struct ahci_port_priv *pp = ap->private_data;
1218-
void __iomem *mmio = ap->host_set->mmio_base;
1218+
void __iomem *mmio = ap->host->mmio_base;
12191219
void __iomem *port_mmio = ahci_port_base(mmio, ap->port_no);
12201220
const char *emsg = NULL;
12211221
int rc;
@@ -1233,8 +1233,8 @@ static int ahci_port_suspend(struct ata_port *ap, pm_message_t mesg)
12331233
static int ahci_port_resume(struct ata_port *ap)
12341234
{
12351235
struct ahci_port_priv *pp = ap->private_data;
1236-
struct ahci_host_priv *hpriv = ap->host_set->private_data;
1237-
void __iomem *mmio = ap->host_set->mmio_base;
1236+
struct ahci_host_priv *hpriv = ap->host->private_data;
1237+
void __iomem *mmio = ap->host->mmio_base;
12381238
void __iomem *port_mmio = ahci_port_base(mmio, ap->port_no);
12391239

12401240
ahci_init_port(port_mmio, hpriv->cap, pp->cmd_slot_dma, pp->rx_fis_dma);
@@ -1244,8 +1244,8 @@ static int ahci_port_resume(struct ata_port *ap)
12441244

12451245
static int ahci_pci_device_suspend(struct pci_dev *pdev, pm_message_t mesg)
12461246
{
1247-
struct ata_host_set *host_set = dev_get_drvdata(&pdev->dev);
1248-
void __iomem *mmio = host_set->mmio_base;
1247+
struct ata_host *host = dev_get_drvdata(&pdev->dev);
1248+
void __iomem *mmio = host->mmio_base;
12491249
u32 ctl;
12501250

12511251
if (mesg.event == PM_EVENT_SUSPEND) {
@@ -1264,9 +1264,9 @@ static int ahci_pci_device_suspend(struct pci_dev *pdev, pm_message_t mesg)
12641264

12651265
static int ahci_pci_device_resume(struct pci_dev *pdev)
12661266
{
1267-
struct ata_host_set *host_set = dev_get_drvdata(&pdev->dev);
1268-
struct ahci_host_priv *hpriv = host_set->private_data;
1269-
void __iomem *mmio = host_set->mmio_base;
1267+
struct ata_host *host = dev_get_drvdata(&pdev->dev);
1268+
struct ahci_host_priv *hpriv = host->private_data;
1269+
void __iomem *mmio = host->mmio_base;
12701270
int rc;
12711271

12721272
ata_pci_device_do_resume(pdev);
@@ -1276,20 +1276,20 @@ static int ahci_pci_device_resume(struct pci_dev *pdev)
12761276
if (rc)
12771277
return rc;
12781278

1279-
ahci_init_controller(mmio, pdev, host_set->n_ports, hpriv->cap);
1279+
ahci_init_controller(mmio, pdev, host->n_ports, hpriv->cap);
12801280
}
12811281

1282-
ata_host_set_resume(host_set);
1282+
ata_host_resume(host);
12831283

12841284
return 0;
12851285
}
12861286

12871287
static int ahci_port_start(struct ata_port *ap)
12881288
{
1289-
struct device *dev = ap->host_set->dev;
1290-
struct ahci_host_priv *hpriv = ap->host_set->private_data;
1289+
struct device *dev = ap->host->dev;
1290+
struct ahci_host_priv *hpriv = ap->host->private_data;
12911291
struct ahci_port_priv *pp;
1292-
void __iomem *mmio = ap->host_set->mmio_base;
1292+
void __iomem *mmio = ap->host->mmio_base;
12931293
void __iomem *port_mmio = ahci_port_base(mmio, ap->port_no);
12941294
void *mem;
12951295
dma_addr_t mem_dma;
@@ -1350,10 +1350,10 @@ static int ahci_port_start(struct ata_port *ap)
13501350

13511351
static void ahci_port_stop(struct ata_port *ap)
13521352
{
1353-
struct device *dev = ap->host_set->dev;
1354-
struct ahci_host_priv *hpriv = ap->host_set->private_data;
1353+
struct device *dev = ap->host->dev;
1354+
struct ahci_host_priv *hpriv = ap->host->private_data;
13551355
struct ahci_port_priv *pp = ap->private_data;
1356-
void __iomem *mmio = ap->host_set->mmio_base;
1356+
void __iomem *mmio = ap->host->mmio_base;
13571357
void __iomem *port_mmio = ahci_port_base(mmio, ap->port_no);
13581358
const char *emsg = NULL;
13591359
int rc;
@@ -1581,7 +1581,7 @@ static int ahci_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
15811581
memset(hpriv, 0, sizeof(*hpriv));
15821582

15831583
probe_ent->sht = ahci_port_info[board_idx].sht;
1584-
probe_ent->host_flags = ahci_port_info[board_idx].host_flags;
1584+
probe_ent->port_flags = ahci_port_info[board_idx].flags;
15851585
probe_ent->pio_mask = ahci_port_info[board_idx].pio_mask;
15861586
probe_ent->udma_mask = ahci_port_info[board_idx].udma_mask;
15871587
probe_ent->port_ops = ahci_port_info[board_idx].port_ops;
@@ -1599,9 +1599,9 @@ static int ahci_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
15991599
if (rc)
16001600
goto err_out_hpriv;
16011601

1602-
if (!(probe_ent->host_flags & AHCI_FLAG_NO_NCQ) &&
1602+
if (!(probe_ent->port_flags & AHCI_FLAG_NO_NCQ) &&
16031603
(hpriv->cap & HOST_CAP_NCQ))
1604-
probe_ent->host_flags |= ATA_FLAG_NCQ;
1604+
probe_ent->port_flags |= ATA_FLAG_NCQ;
16051605

16061606
ahci_print_info(probe_ent);
16071607

@@ -1632,27 +1632,27 @@ static int ahci_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
16321632
static void ahci_remove_one (struct pci_dev *pdev)
16331633
{
16341634
struct device *dev = pci_dev_to_dev(pdev);
1635-
struct ata_host_set *host_set = dev_get_drvdata(dev);
1636-
struct ahci_host_priv *hpriv = host_set->private_data;
1635+
struct ata_host *host = dev_get_drvdata(dev);
1636+
struct ahci_host_priv *hpriv = host->private_data;
16371637
unsigned int i;
16381638
int have_msi;
16391639

1640-
for (i = 0; i < host_set->n_ports; i++)
1641-
ata_port_detach(host_set->ports[i]);
1640+
for (i = 0; i < host->n_ports; i++)
1641+
ata_port_detach(host->ports[i]);
16421642

16431643
have_msi = hpriv->flags & AHCI_FLAG_MSI;
1644-
free_irq(host_set->irq, host_set);
1644+
free_irq(host->irq, host);
16451645

1646-
for (i = 0; i < host_set->n_ports; i++) {
1647-
struct ata_port *ap = host_set->ports[i];
1646+
for (i = 0; i < host->n_ports; i++) {
1647+
struct ata_port *ap = host->ports[i];
16481648

1649-
ata_scsi_release(ap->host);
1650-
scsi_host_put(ap->host);
1649+
ata_scsi_release(ap->scsi_host);
1650+
scsi_host_put(ap->scsi_host);
16511651
}
16521652

16531653
kfree(hpriv);
1654-
pci_iounmap(pdev, host_set->mmio_base);
1655-
kfree(host_set);
1654+
pci_iounmap(pdev, host->mmio_base);
1655+
kfree(host);
16561656

16571657
if (have_msi)
16581658
pci_disable_msi(pdev);

0 commit comments

Comments
 (0)