提交 36f674d9 编写于 作者: T Tejun Heo 提交者: Jeff Garzik

sata_inic162x: misc clean ups

* use larger indents for structure member definitions

* kill unused variable @addr in inic_scr_write()

* kill unnecessary flushes in inic_freeze/thaw()

* kill buggy explicit kfree() on devres managed port private data

This is in preparation of further inic162x updates.
Signed-off-by: NTejun Heo <htejun@gmail.com>
Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
上级 c46938cc
...@@ -185,12 +185,10 @@ static int inic_scr_read(struct ata_port *ap, unsigned sc_reg, u32 *val) ...@@ -185,12 +185,10 @@ static int inic_scr_read(struct ata_port *ap, unsigned sc_reg, u32 *val)
static int inic_scr_write(struct ata_port *ap, unsigned sc_reg, u32 val) static int inic_scr_write(struct ata_port *ap, unsigned sc_reg, u32 val)
{ {
void __iomem *scr_addr = ap->ioaddr.scr_addr; void __iomem *scr_addr = ap->ioaddr.scr_addr;
void __iomem *addr;
if (unlikely(sc_reg >= ARRAY_SIZE(scr_map))) if (unlikely(sc_reg >= ARRAY_SIZE(scr_map)))
return -EINVAL; return -EINVAL;
addr = scr_addr + scr_map[sc_reg] * 4;
writel(val, scr_addr + scr_map[sc_reg] * 4); writel(val, scr_addr + scr_map[sc_reg] * 4);
return 0; return 0;
} }
...@@ -367,8 +365,6 @@ static void inic_freeze(struct ata_port *ap) ...@@ -367,8 +365,6 @@ static void inic_freeze(struct ata_port *ap)
ap->ops->sff_check_status(ap); ap->ops->sff_check_status(ap);
writeb(0xff, port_base + PORT_IRQ_STAT); writeb(0xff, port_base + PORT_IRQ_STAT);
readb(port_base + PORT_IRQ_STAT); /* flush */
} }
static void inic_thaw(struct ata_port *ap) static void inic_thaw(struct ata_port *ap)
...@@ -379,8 +375,6 @@ static void inic_thaw(struct ata_port *ap) ...@@ -379,8 +375,6 @@ static void inic_thaw(struct ata_port *ap)
writeb(0xff, port_base + PORT_IRQ_STAT); writeb(0xff, port_base + PORT_IRQ_STAT);
__inic_set_pirq_mask(ap, PIRQ_MASK_OTHER); __inic_set_pirq_mask(ap, PIRQ_MASK_OTHER);
readb(port_base + PORT_IRQ_STAT); /* flush */
} }
/* /*
...@@ -506,10 +500,8 @@ static int inic_port_start(struct ata_port *ap) ...@@ -506,10 +500,8 @@ static int inic_port_start(struct ata_port *ap)
/* Alloc resources */ /* Alloc resources */
rc = ata_port_start(ap); rc = ata_port_start(ap);
if (rc) { if (rc)
kfree(pp);
return rc; return rc;
}
init_port(ap); init_port(ap);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册