Commit 09bc85b0 authored by Geert Uytterhoeven's avatar Geert Uytterhoeven Committed by James Bottomley

[SCSI] a2091: Reindentation

Signed-off-by: default avatarGeert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@suse.de>
parent 900e8d6b
...@@ -19,21 +19,22 @@ ...@@ -19,21 +19,22 @@
#include "wd33c93.h" #include "wd33c93.h"
#include "a2091.h" #include "a2091.h"
#include<linux/stat.h> #include <linux/stat.h>
#define DMA(ptr) ((a2091_scsiregs *)((ptr)->base)) #define DMA(ptr) ((a2091_scsiregs *)((ptr)->base))
#define HDATA(ptr) ((struct WD33C93_hostdata *)((ptr)->hostdata)) #define HDATA(ptr) ((struct WD33C93_hostdata *)((ptr)->hostdata))
static int a2091_release(struct Scsi_Host *instance); static int a2091_release(struct Scsi_Host *instance);
static irqreturn_t a2091_intr (int irq, void *_instance) static irqreturn_t a2091_intr(int irq, void *_instance)
{ {
unsigned long flags; unsigned long flags;
unsigned int status; unsigned int status;
struct Scsi_Host *instance = (struct Scsi_Host *)_instance; struct Scsi_Host *instance = (struct Scsi_Host *)_instance;
status = DMA(instance)->ISTR; status = DMA(instance)->ISTR;
if (!(status & (ISTR_INT_F|ISTR_INT_P)) || !(status & ISTR_INTS)) if (!(status & (ISTR_INT_F | ISTR_INT_P)) || !(status & ISTR_INTS))
return IRQ_NONE; return IRQ_NONE;
spin_lock_irqsave(instance->host_lock, flags); spin_lock_irqsave(instance->host_lock, flags);
...@@ -49,12 +50,11 @@ static int dma_setup(struct scsi_cmnd *cmd, int dir_in) ...@@ -49,12 +50,11 @@ static int dma_setup(struct scsi_cmnd *cmd, int dir_in)
struct Scsi_Host *instance = cmd->device->host; struct Scsi_Host *instance = cmd->device->host;
/* don't allow DMA if the physical address is bad */ /* don't allow DMA if the physical address is bad */
if (addr & A2091_XFER_MASK) if (addr & A2091_XFER_MASK) {
{ HDATA(instance)->dma_bounce_len =
HDATA(instance)->dma_bounce_len = (cmd->SCp.this_residual + 511) (cmd->SCp.this_residual + 511) & ~0x1ff;
& ~0x1ff;
HDATA(instance)->dma_bounce_buffer = HDATA(instance)->dma_bounce_buffer =
kmalloc (HDATA(instance)->dma_bounce_len, GFP_KERNEL); kmalloc(HDATA(instance)->dma_bounce_len, GFP_KERNEL);
/* can't allocate memory; use PIO */ /* can't allocate memory; use PIO */
if (!HDATA(instance)->dma_bounce_buffer) { if (!HDATA(instance)->dma_bounce_buffer) {
...@@ -68,7 +68,7 @@ static int dma_setup(struct scsi_cmnd *cmd, int dir_in) ...@@ -68,7 +68,7 @@ static int dma_setup(struct scsi_cmnd *cmd, int dir_in)
/* the bounce buffer may not be in the first 16M of physmem */ /* the bounce buffer may not be in the first 16M of physmem */
if (addr & A2091_XFER_MASK) { if (addr & A2091_XFER_MASK) {
/* we could use chipmem... maybe later */ /* we could use chipmem... maybe later */
kfree (HDATA(instance)->dma_bounce_buffer); kfree(HDATA(instance)->dma_bounce_buffer);
HDATA(instance)->dma_bounce_buffer = NULL; HDATA(instance)->dma_bounce_buffer = NULL;
HDATA(instance)->dma_bounce_len = 0; HDATA(instance)->dma_bounce_len = 0;
return 1; return 1;
...@@ -76,7 +76,7 @@ static int dma_setup(struct scsi_cmnd *cmd, int dir_in) ...@@ -76,7 +76,7 @@ static int dma_setup(struct scsi_cmnd *cmd, int dir_in)
if (!dir_in) { if (!dir_in) {
/* copy to bounce buffer for a write */ /* copy to bounce buffer for a write */
memcpy (HDATA(instance)->dma_bounce_buffer, memcpy(HDATA(instance)->dma_bounce_buffer,
cmd->SCp.ptr, cmd->SCp.this_residual); cmd->SCp.ptr, cmd->SCp.this_residual);
} }
} }
...@@ -93,12 +93,12 @@ static int dma_setup(struct scsi_cmnd *cmd, int dir_in) ...@@ -93,12 +93,12 @@ static int dma_setup(struct scsi_cmnd *cmd, int dir_in)
/* setup DMA *physical* address */ /* setup DMA *physical* address */
DMA(cmd->device->host)->ACR = addr; DMA(cmd->device->host)->ACR = addr;
if (dir_in){ if (dir_in) {
/* invalidate any cache */ /* invalidate any cache */
cache_clear (addr, cmd->SCp.this_residual); cache_clear(addr, cmd->SCp.this_residual);
}else{ } else {
/* push any dirty cache */ /* push any dirty cache */
cache_push (addr, cmd->SCp.this_residual); cache_push(addr, cmd->SCp.this_residual);
} }
/* start DMA */ /* start DMA */
DMA(cmd->device->host)->ST_DMA = 1; DMA(cmd->device->host)->ST_DMA = 1;
...@@ -137,11 +137,11 @@ static void dma_stop(struct Scsi_Host *instance, struct scsi_cmnd *SCpnt, ...@@ -137,11 +137,11 @@ static void dma_stop(struct Scsi_Host *instance, struct scsi_cmnd *SCpnt,
/* copy from a bounce buffer, if necessary */ /* copy from a bounce buffer, if necessary */
if (status && HDATA(instance)->dma_bounce_buffer) { if (status && HDATA(instance)->dma_bounce_buffer) {
if( HDATA(instance)->dma_dir ) if (HDATA(instance)->dma_dir)
memcpy (SCpnt->SCp.ptr, memcpy(SCpnt->SCp.ptr,
HDATA(instance)->dma_bounce_buffer, HDATA(instance)->dma_bounce_buffer,
SCpnt->SCp.this_residual); SCpnt->SCp.this_residual);
kfree (HDATA(instance)->dma_bounce_buffer); kfree(HDATA(instance)->dma_bounce_buffer);
HDATA(instance)->dma_bounce_buffer = NULL; HDATA(instance)->dma_bounce_buffer = NULL;
HDATA(instance)->dma_bounce_len = 0; HDATA(instance)->dma_bounce_len = 0;
} }
...@@ -171,7 +171,7 @@ static int __init a2091_detect(struct scsi_host_template *tpnt) ...@@ -171,7 +171,7 @@ static int __init a2091_detect(struct scsi_host_template *tpnt)
if (!request_mem_region(address, 256, "wd33c93")) if (!request_mem_region(address, 256, "wd33c93"))
continue; continue;
instance = scsi_register (tpnt, sizeof (struct WD33C93_hostdata)); instance = scsi_register(tpnt, sizeof(struct WD33C93_hostdata));
if (instance == NULL) if (instance == NULL)
goto release; goto release;
instance->base = ZTWO_VADDR(address); instance->base = ZTWO_VADDR(address);
...@@ -183,9 +183,10 @@ static int __init a2091_detect(struct scsi_host_template *tpnt) ...@@ -183,9 +183,10 @@ static int __init a2091_detect(struct scsi_host_template *tpnt)
HDATA(instance)->no_sync = 0xff; HDATA(instance)->no_sync = 0xff;
HDATA(instance)->fast = 0; HDATA(instance)->fast = 0;
HDATA(instance)->dma_mode = CTRL_DMA; HDATA(instance)->dma_mode = CTRL_DMA;
wd33c93_init(instance, regs, dma_setup, dma_stop, WD33C93_FS_8_10); wd33c93_init(instance, regs, dma_setup, dma_stop,
if (request_irq(IRQ_AMIGA_PORTS, a2091_intr, IRQF_SHARED, "A2091 SCSI", WD33C93_FS_8_10);
instance)) if (request_irq(IRQ_AMIGA_PORTS, a2091_intr, IRQF_SHARED,
"A2091 SCSI", instance))
goto unregister; goto unregister;
DMA(instance)->CNTR = CNTR_PDMD | CNTR_INTEN; DMA(instance)->CNTR = CNTR_PDMD | CNTR_INTEN;
num_a2091++; num_a2091++;
......
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