Skip to content

Commit

Permalink
libata-sff: ap->[last_]ctl are SFF specific
Browse files Browse the repository at this point in the history
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: Tejun Heo <tj@kernel.org>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
  • Loading branch information
Tejun Heo authored and Jeff Garzik committed May 19, 2010
1 parent 8244cd0 commit 5fe7454
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
2 changes: 0 additions & 2 deletions drivers/ata/libata-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -5634,10 +5634,8 @@ struct ata_port *ata_port_alloc(struct ata_host *host)
ap->pflags |= ATA_PFLAG_INITIALIZING;
ap->lock = &host->lock;
ap->print_id = -1;
ap->ctl = ATA_DEVCTL_OBS;
ap->host = host;
ap->dev = host->dev;
ap->last_ctl = 0xFF;

#if defined(ATA_VERBOSE_DEBUG)
/* turn on all debugging levels */
Expand Down
2 changes: 2 additions & 0 deletions drivers/ata/libata-sff.c
Original file line number Diff line number Diff line change
Expand Up @@ -3074,6 +3074,8 @@ EXPORT_SYMBOL_GPL(ata_pci_bmdma_init);
*/
void ata_sff_port_init(struct ata_port *ap)
{
ap->ctl = ATA_DEVCTL_OBS;
ap->last_ctl = 0xFF;
}

int __init ata_sff_init(void)
Expand Down
8 changes: 6 additions & 2 deletions include/linux/libata.h
Original file line number Diff line number Diff line change
Expand Up @@ -721,10 +721,10 @@ struct ata_port {

#ifdef CONFIG_ATA_SFF
struct ata_ioports ioaddr; /* ATA cmd/ctl/dma register blocks */
#endif /* CONFIG_ATA_SFF */

u8 ctl; /* cache of ATA control register */
u8 last_ctl; /* Cache last written value */
#endif /* CONFIG_ATA_SFF */

unsigned int pio_mask;
unsigned int mwdma_mask;
unsigned int udma_mask;
Expand Down Expand Up @@ -1435,7 +1435,11 @@ static inline void ata_tf_init(struct ata_device *dev, struct ata_taskfile *tf)
{
memset(tf, 0, sizeof(*tf));

#ifdef CONFIG_ATA_SFF
tf->ctl = dev->link->ap->ctl;
#else
tf->ctl = ATA_DEVCTL_OBS;
#endif
if (dev->devno == 0)
tf->device = ATA_DEVICE_OBS;
else
Expand Down

0 comments on commit 5fe7454

Please sign in to comment.