Commit 5fe7454a authored by Tejun Heo's avatar Tejun Heo Committed by Jeff Garzik

libata-sff: ap->[last_]ctl are SFF specific

ap->[last_]ctl are specific to SFF controllers.  Put them inside
CONFIG_ATA_SFF and move initialization into ata_sff_port_init().
Signed-off-by: default avatarTejun Heo <tj@kernel.org>
Signed-off-by: default avatarJeff Garzik <jgarzik@redhat.com>
parent 8244cd05
...@@ -5634,10 +5634,8 @@ struct ata_port *ata_port_alloc(struct ata_host *host) ...@@ -5634,10 +5634,8 @@ struct ata_port *ata_port_alloc(struct ata_host *host)
ap->pflags |= ATA_PFLAG_INITIALIZING; ap->pflags |= ATA_PFLAG_INITIALIZING;
ap->lock = &host->lock; ap->lock = &host->lock;
ap->print_id = -1; ap->print_id = -1;
ap->ctl = ATA_DEVCTL_OBS;
ap->host = host; ap->host = host;
ap->dev = host->dev; ap->dev = host->dev;
ap->last_ctl = 0xFF;
#if defined(ATA_VERBOSE_DEBUG) #if defined(ATA_VERBOSE_DEBUG)
/* turn on all debugging levels */ /* turn on all debugging levels */
......
...@@ -3074,6 +3074,8 @@ EXPORT_SYMBOL_GPL(ata_pci_bmdma_init); ...@@ -3074,6 +3074,8 @@ EXPORT_SYMBOL_GPL(ata_pci_bmdma_init);
*/ */
void ata_sff_port_init(struct ata_port *ap) void ata_sff_port_init(struct ata_port *ap)
{ {
ap->ctl = ATA_DEVCTL_OBS;
ap->last_ctl = 0xFF;
} }
int __init ata_sff_init(void) int __init ata_sff_init(void)
......
...@@ -721,10 +721,10 @@ struct ata_port { ...@@ -721,10 +721,10 @@ struct ata_port {
#ifdef CONFIG_ATA_SFF #ifdef CONFIG_ATA_SFF
struct ata_ioports ioaddr; /* ATA cmd/ctl/dma register blocks */ struct ata_ioports ioaddr; /* ATA cmd/ctl/dma register blocks */
#endif /* CONFIG_ATA_SFF */
u8 ctl; /* cache of ATA control register */ u8 ctl; /* cache of ATA control register */
u8 last_ctl; /* Cache last written value */ u8 last_ctl; /* Cache last written value */
#endif /* CONFIG_ATA_SFF */
unsigned int pio_mask; unsigned int pio_mask;
unsigned int mwdma_mask; unsigned int mwdma_mask;
unsigned int udma_mask; unsigned int udma_mask;
...@@ -1435,7 +1435,11 @@ static inline void ata_tf_init(struct ata_device *dev, struct ata_taskfile *tf) ...@@ -1435,7 +1435,11 @@ static inline void ata_tf_init(struct ata_device *dev, struct ata_taskfile *tf)
{ {
memset(tf, 0, sizeof(*tf)); memset(tf, 0, sizeof(*tf));
#ifdef CONFIG_ATA_SFF
tf->ctl = dev->link->ap->ctl; tf->ctl = dev->link->ap->ctl;
#else
tf->ctl = ATA_DEVCTL_OBS;
#endif
if (dev->devno == 0) if (dev->devno == 0)
tf->device = ATA_DEVICE_OBS; tf->device = ATA_DEVICE_OBS;
else else
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment