aboutsummaryrefslogtreecommitdiffstats
path: root/target
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2014-12-22 20:47:10 +0000
committerFelix Fietkau <nbd@openwrt.org>2014-12-22 20:47:10 +0000
commitd1f285d96c5c05be58bdaec1ae6d19548f7453ba (patch)
tree10c0b862edda30901d26b5927ae0a49536326b93 /target
parent3230566326578913c11d23fa316cba637a7f52d9 (diff)
downloadupstream-d1f285d96c5c05be58bdaec1ae6d19548f7453ba.tar.gz
upstream-d1f285d96c5c05be58bdaec1ae6d19548f7453ba.tar.bz2
upstream-d1f285d96c5c05be58bdaec1ae6d19548f7453ba.zip
oxnas: sata_oxnas: make irq handler more readable
safed one level of indention by using 'continue' instead of a lengthy if-clause. Signed-off-by: Daniel Golle <daniel@makrotopia.org> v2: use logic-AND instead of '?' operator when checking for hw bug 6320 git-svn-id: svn://svn.openwrt.org/openwrt/trunk@43768 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target')
-rw-r--r--target/linux/oxnas/files/drivers/ata/sata_oxnas.c25
1 files changed, 13 insertions, 12 deletions
diff --git a/target/linux/oxnas/files/drivers/ata/sata_oxnas.c b/target/linux/oxnas/files/drivers/ata/sata_oxnas.c
index 30bcb23b1e..291a06f959 100644
--- a/target/linux/oxnas/files/drivers/ata/sata_oxnas.c
+++ b/target/linux/oxnas/files/drivers/ata/sata_oxnas.c
@@ -2041,7 +2041,7 @@ int sata_oxnas_init_controller(struct ata_host *host)
*
* @param port SATA port to check and if necessary, correct.
*/
-static int sata_oxnas_bug_6320_workaround(struct ata_port *ap)
+static int sata_oxnas_bug_6320_detect(struct ata_port *ap)
{
struct sata_oxnas_port_priv *pd = ap->private_data;
void __iomem *core_base = pd->core_base;
@@ -2175,17 +2175,18 @@ static irqreturn_t sata_oxnas_interrupt(int irq, void *dev_instance)
/* check the raw end of command interrupt to see if the
* port is done */
mask = (COREINT_END << port_no);
- if (int_status & mask) {
- /* this port had an interrupt, clear it */
- iowrite32(mask, core_base + CORE_INT_CLEAR);
- bug_present =
- (hd->current_ucode == UNKNOWN_MODE) ?
- sata_oxnas_bug_6320_workaround(
- ah->ports[port_no]):0;
- sata_oxnas_port_irq(ah->ports[port_no],
- bug_present);
- ret = IRQ_HANDLED;
- }
+ if (!(int_status & mask))
+ continue;
+
+ /* this port had an interrupt, clear it */
+ iowrite32(mask, core_base + CORE_INT_CLEAR);
+ /* check for bug 6320 only if no microcode was loaded */
+ bug_present = (hd->current_ucode == UNKNOWN_MODE) &&
+ sata_oxnas_bug_6320_detect(ah->ports[port_no]);
+
+ sata_oxnas_port_irq(ah->ports[port_no],
+ bug_present);
+ ret = IRQ_HANDLED;
}
}