Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 93383
b: refs/heads/master
c: 8e5443a
h: refs/heads/master
i:
  93381: 600a3ed
  93379: c6b6737
  93375: 35f9ff3
v: v3
  • Loading branch information
Tejun Heo authored and Jeff Garzik committed Apr 25, 2008
1 parent a189fb6 commit 324f654
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 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: 2b4221bb545899b05872e7b51f55567c10b3894b
refs/heads/master: 8e5443a09851d99084098ecc4066805aa2610d92
12 changes: 7 additions & 5 deletions trunk/drivers/ata/sata_sis.c
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ static u32 sis_scr_cfg_read(struct ata_port *ap, unsigned int sc_reg, u32 *val)
u8 pmr;

if (sc_reg == SCR_ERROR) /* doesn't exist in PCI cfg space */
return 0xffffffff;
return -EINVAL;

pci_read_config_byte(pdev, SIS_PMR, &pmr);

Expand All @@ -158,14 +158,14 @@ static u32 sis_scr_cfg_read(struct ata_port *ap, unsigned int sc_reg, u32 *val)
return 0;
}

static void sis_scr_cfg_write(struct ata_port *ap, unsigned int sc_reg, u32 val)
static int sis_scr_cfg_write(struct ata_port *ap, unsigned int sc_reg, u32 val)
{
struct pci_dev *pdev = to_pci_dev(ap->host->dev);
unsigned int cfg_addr = get_scr_cfg_addr(ap, sc_reg);
u8 pmr;

if (sc_reg == SCR_ERROR) /* doesn't exist in PCI cfg space */
return;
return -EINVAL;

pci_read_config_byte(pdev, SIS_PMR, &pmr);

Expand All @@ -174,6 +174,8 @@ static void sis_scr_cfg_write(struct ata_port *ap, unsigned int sc_reg, u32 val)
if ((pdev->device == 0x0182) || (pdev->device == 0x0183) ||
(pdev->device == 0x1182) || (pmr & SIS_PMR_COMBINED))
pci_write_config_dword(pdev, cfg_addr+0x10, val);

return 0;
}

static int sis_scr_read(struct ata_port *ap, unsigned int sc_reg, u32 *val)
Expand Down Expand Up @@ -211,14 +213,14 @@ static int sis_scr_write(struct ata_port *ap, unsigned int sc_reg, u32 val)
pci_read_config_byte(pdev, SIS_PMR, &pmr);

if (ap->flags & SIS_FLAG_CFGSCR)
sis_scr_cfg_write(ap, sc_reg, val);
return sis_scr_cfg_write(ap, sc_reg, val);
else {
iowrite32(val, ap->ioaddr.scr_addr + (sc_reg * 4));
if ((pdev->device == 0x0182) || (pdev->device == 0x0183) ||
(pdev->device == 0x1182) || (pmr & SIS_PMR_COMBINED))
iowrite32(val, ap->ioaddr.scr_addr + (sc_reg * 4)+0x10);
return 0;
}
return 0;
}

static int sis_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
Expand Down

0 comments on commit 324f654

Please sign in to comment.