diff options
| -rw-r--r-- | drivers/ata/sata_inic162x.c | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/drivers/ata/sata_inic162x.c b/drivers/ata/sata_inic162x.c index d27bb9a2568f..1f5d17eb0f38 100644 --- a/drivers/ata/sata_inic162x.c +++ b/drivers/ata/sata_inic162x.c | |||
| @@ -99,13 +99,13 @@ enum { | |||
| 99 | }; | 99 | }; |
| 100 | 100 | ||
| 101 | struct inic_host_priv { | 101 | struct inic_host_priv { |
| 102 | u16 cached_hctl; | 102 | u16 cached_hctl; |
| 103 | }; | 103 | }; |
| 104 | 104 | ||
| 105 | struct inic_port_priv { | 105 | struct inic_port_priv { |
| 106 | u8 dfl_prdctl; | 106 | u8 dfl_prdctl; |
| 107 | u8 cached_prdctl; | 107 | u8 cached_prdctl; |
| 108 | u8 cached_pirq_mask; | 108 | u8 cached_pirq_mask; |
| 109 | }; | 109 | }; |
| 110 | 110 | ||
| 111 | static struct scsi_host_template inic_sht = { | 111 | static struct scsi_host_template inic_sht = { |
| @@ -185,12 +185,10 @@ static int inic_scr_read(struct ata_port *ap, unsigned sc_reg, u32 *val) | |||
| 185 | static int inic_scr_write(struct ata_port *ap, unsigned sc_reg, u32 val) | 185 | static int inic_scr_write(struct ata_port *ap, unsigned sc_reg, u32 val) |
| 186 | { | 186 | { |
| 187 | void __iomem *scr_addr = ap->ioaddr.scr_addr; | 187 | void __iomem *scr_addr = ap->ioaddr.scr_addr; |
| 188 | void __iomem *addr; | ||
| 189 | 188 | ||
| 190 | if (unlikely(sc_reg >= ARRAY_SIZE(scr_map))) | 189 | if (unlikely(sc_reg >= ARRAY_SIZE(scr_map))) |
| 191 | return -EINVAL; | 190 | return -EINVAL; |
| 192 | 191 | ||
| 193 | addr = scr_addr + scr_map[sc_reg] * 4; | ||
| 194 | writel(val, scr_addr + scr_map[sc_reg] * 4); | 192 | writel(val, scr_addr + scr_map[sc_reg] * 4); |
| 195 | return 0; | 193 | return 0; |
| 196 | } | 194 | } |
| @@ -367,8 +365,6 @@ static void inic_freeze(struct ata_port *ap) | |||
| 367 | 365 | ||
| 368 | ap->ops->sff_check_status(ap); | 366 | ap->ops->sff_check_status(ap); |
| 369 | writeb(0xff, port_base + PORT_IRQ_STAT); | 367 | writeb(0xff, port_base + PORT_IRQ_STAT); |
| 370 | |||
| 371 | readb(port_base + PORT_IRQ_STAT); /* flush */ | ||
| 372 | } | 368 | } |
| 373 | 369 | ||
| 374 | static void inic_thaw(struct ata_port *ap) | 370 | static void inic_thaw(struct ata_port *ap) |
| @@ -379,8 +375,6 @@ static void inic_thaw(struct ata_port *ap) | |||
| 379 | writeb(0xff, port_base + PORT_IRQ_STAT); | 375 | writeb(0xff, port_base + PORT_IRQ_STAT); |
| 380 | 376 | ||
| 381 | __inic_set_pirq_mask(ap, PIRQ_MASK_OTHER); | 377 | __inic_set_pirq_mask(ap, PIRQ_MASK_OTHER); |
| 382 | |||
| 383 | readb(port_base + PORT_IRQ_STAT); /* flush */ | ||
| 384 | } | 378 | } |
| 385 | 379 | ||
| 386 | /* | 380 | /* |
| @@ -506,10 +500,8 @@ static int inic_port_start(struct ata_port *ap) | |||
| 506 | 500 | ||
| 507 | /* Alloc resources */ | 501 | /* Alloc resources */ |
| 508 | rc = ata_port_start(ap); | 502 | rc = ata_port_start(ap); |
| 509 | if (rc) { | 503 | if (rc) |
| 510 | kfree(pp); | ||
| 511 | return rc; | 504 | return rc; |
| 512 | } | ||
| 513 | 505 | ||
| 514 | init_port(ap); | 506 | init_port(ap); |
| 515 | 507 | ||
