Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 287485
b: refs/heads/master
c: 2d5091e
h: refs/heads/master
i:
  287483: a684737
v: v3
  • Loading branch information
Wolfgang Zarre authored and Marc Kleine-Budde committed Feb 2, 2012
1 parent 9e1ce7d commit c6e3f1d
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 7bb4db93ae59e0faf810a83a8578f56bc968ab01
refs/heads/master: 2d5091e08c684912ed6b9ca03d1f7b01501b7bf6
16 changes: 15 additions & 1 deletion trunk/drivers/net/can/cc770/cc770_isa.c
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,11 @@ MODULE_PARM_DESC(bcr, "Bus configuration register (default=0x40 [CBY])");
#define CC770_IOSIZE 0x20
#define CC770_IOSIZE_INDIRECT 0x02

/* Spinlock for cc770_isa_port_write_reg_indirect
* and cc770_isa_port_read_reg_indirect
*/
static DEFINE_SPINLOCK(cc770_isa_port_lock);

static struct platform_device *cc770_isa_devs[MAXDEV];

static u8 cc770_isa_mem_read_reg(const struct cc770_priv *priv, int reg)
Expand Down Expand Up @@ -138,18 +143,27 @@ static u8 cc770_isa_port_read_reg_indirect(const struct cc770_priv *priv,
int reg)
{
unsigned long base = (unsigned long)priv->reg_base;
unsigned long flags;
u8 val;

spin_lock_irqsave(&cc770_isa_port_lock, flags);
outb(reg, base);
return inb(base + 1);
val = inb(base + 1);
spin_unlock_irqrestore(&cc770_isa_port_lock, flags);

return val;
}

static void cc770_isa_port_write_reg_indirect(const struct cc770_priv *priv,
int reg, u8 val)
{
unsigned long base = (unsigned long)priv->reg_base;
unsigned long flags;

spin_lock_irqsave(&cc770_isa_port_lock, flags);
outb(reg, base);
outb(val, base + 1);
spin_unlock_irqrestore(&cc770_isa_port_lock, flags);
}

static int __devinit cc770_isa_probe(struct platform_device *pdev)
Expand Down

0 comments on commit c6e3f1d

Please sign in to comment.