mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-11-27 01:11:31 +00:00
[PARPORT] SUNBPP: Fix OOPS when debugging is enabled.
The debugging code would dereference __iomem pointers instead
of going through sbus_{read,write}{b,w,l}().
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
7e9f334615
commit
5a68b2e346
1 changed files with 6 additions and 4 deletions
|
|
@ -126,7 +126,7 @@ static unsigned char status_sunbpp_to_pc(struct parport *p)
|
||||||
if (!(value_tcr & P_TCR_BUSY))
|
if (!(value_tcr & P_TCR_BUSY))
|
||||||
bits |= PARPORT_STATUS_BUSY;
|
bits |= PARPORT_STATUS_BUSY;
|
||||||
|
|
||||||
dprintk((KERN_DEBUG "tcr 0x%x ir 0x%x\n", regs->p_tcr, regs->p_ir));
|
dprintk((KERN_DEBUG "tcr 0x%x ir 0x%x\n", value_tcr, value_ir));
|
||||||
dprintk((KERN_DEBUG "read status 0x%x\n", bits));
|
dprintk((KERN_DEBUG "read status 0x%x\n", bits));
|
||||||
return bits;
|
return bits;
|
||||||
}
|
}
|
||||||
|
|
@ -147,7 +147,7 @@ static unsigned char control_sunbpp_to_pc(struct parport *p)
|
||||||
if (value_or & P_OR_SLCT_IN)
|
if (value_or & P_OR_SLCT_IN)
|
||||||
bits |= PARPORT_CONTROL_SELECT;
|
bits |= PARPORT_CONTROL_SELECT;
|
||||||
|
|
||||||
dprintk((KERN_DEBUG "tcr 0x%x or 0x%x\n", regs->p_tcr, regs->p_or));
|
dprintk((KERN_DEBUG "tcr 0x%x or 0x%x\n", value_tcr, value_or));
|
||||||
dprintk((KERN_DEBUG "read control 0x%x\n", bits));
|
dprintk((KERN_DEBUG "read control 0x%x\n", bits));
|
||||||
return bits;
|
return bits;
|
||||||
}
|
}
|
||||||
|
|
@ -165,7 +165,8 @@ static unsigned char parport_sunbpp_frob_control(struct parport *p,
|
||||||
unsigned char value_tcr = sbus_readb(®s->p_tcr);
|
unsigned char value_tcr = sbus_readb(®s->p_tcr);
|
||||||
unsigned char value_or = sbus_readb(®s->p_or);
|
unsigned char value_or = sbus_readb(®s->p_or);
|
||||||
|
|
||||||
dprintk((KERN_DEBUG "frob1: tcr 0x%x or 0x%x\n", regs->p_tcr, regs->p_or));
|
dprintk((KERN_DEBUG "frob1: tcr 0x%x or 0x%x\n",
|
||||||
|
value_tcr, value_or));
|
||||||
if (mask & PARPORT_CONTROL_STROBE) {
|
if (mask & PARPORT_CONTROL_STROBE) {
|
||||||
if (val & PARPORT_CONTROL_STROBE) {
|
if (val & PARPORT_CONTROL_STROBE) {
|
||||||
value_tcr &= ~P_TCR_DS;
|
value_tcr &= ~P_TCR_DS;
|
||||||
|
|
@ -197,7 +198,8 @@ static unsigned char parport_sunbpp_frob_control(struct parport *p,
|
||||||
|
|
||||||
sbus_writeb(value_or, ®s->p_or);
|
sbus_writeb(value_or, ®s->p_or);
|
||||||
sbus_writeb(value_tcr, ®s->p_tcr);
|
sbus_writeb(value_tcr, ®s->p_tcr);
|
||||||
dprintk((KERN_DEBUG "frob2: tcr 0x%x or 0x%x\n", regs->p_tcr, regs->p_or));
|
dprintk((KERN_DEBUG "frob2: tcr 0x%x or 0x%x\n",
|
||||||
|
value_tcr, value_or));
|
||||||
return parport_sunbpp_read_control(p);
|
return parport_sunbpp_read_control(p);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue