Commit c751d9f1fce4187bf1c0848d7d3a5bf7644d7f9c

Authored by Ondrej Zary
Committed by Martin K. Petersen
1 parent 2bbbac4571

atp870u: Fix incorrect writeb_io access to register 0x3a

The ioport region is 0x20 bytes long so accessing 0x3a register using
writeb_io is incorrect. Use writeb_base instead.
There's no change in behavior as 870 chips have ioport = baseport.

Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
Reviewed-by: Hannes Reinicke <hare@suse.de>
Acked-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

Showing 1 changed file with 4 additions and 4 deletions Side-by-side Diff

drivers/scsi/atp870u.c
... ... @@ -364,9 +364,9 @@
364 364 atp_writeb_base(dev, 0x3b, atp_readb_base(dev, 0x3b) & 0x3f);
365 365 } else {
366 366 if ((workreq->cmnd[0] == 0x08) || (workreq->cmnd[0] == 0x28) || (workreq->cmnd[0] == 0x0a) || (workreq->cmnd[0] == 0x2a))
367   - atp_writeb_io(dev, c, 0x3a, (atp_readb_io(dev, c, 0x3a) & 0xf3) | 0x08);
  367 + atp_writeb_base(dev, 0x3a, (atp_readb_base(dev, 0x3a) & 0xf3) | 0x08);
368 368 else
369   - atp_writeb_io(dev, c, 0x3a, atp_readb_io(dev, c, 0x3a) & 0xf3);
  369 + atp_writeb_base(dev, 0x3a, atp_readb_base(dev, 0x3a) & 0xf3);
370 370 }
371 371 j = 0;
372 372 id = 1;
373 373  
... ... @@ -889,9 +889,9 @@
889 889 atp_writeb_base(dev, 0x3b, atp_readb_base(dev, 0x3b) & 0x3f);
890 890 } else {
891 891 if ((workreq->cmnd[0] == 0x08) || (workreq->cmnd[0] == 0x28) || (workreq->cmnd[0] == 0x0a) || (workreq->cmnd[0] == 0x2a))
892   - atp_writeb_io(dev, c, 0x3a, (atp_readb_io(dev, c, 0x3a) & 0xf3) | 0x08);
  892 + atp_writeb_base(dev, 0x3a, (atp_readb_base(dev, 0x3a) & 0xf3) | 0x08);
893 893 else
894   - atp_writeb_io(dev, c, 0x3a, atp_readb_io(dev, c, 0x3a) & 0xf3);
  894 + atp_writeb_base(dev, 0x3a, atp_readb_base(dev, 0x3a) & 0xf3);
895 895 }
896 896  
897 897 if(workreq->sc_data_direction == DMA_TO_DEVICE) {