Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 93534
b: refs/heads/master
c: 1baccff
h: refs/heads/master
v: v3
  • Loading branch information
Sergei Shtylyov authored and Bartlomiej Zolnierkiewicz committed Apr 26, 2008
1 parent 5cf85fb commit 959e505
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 12 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: 938da770c205989945ba4cc5f0b4e255702061a1
refs/heads/master: 1baccff8a5823b51d7bf2740ef3ef17e06bfa7e2
23 changes: 12 additions & 11 deletions trunk/drivers/ide/setup-pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -301,26 +301,24 @@ static int ide_pci_configure(struct pci_dev *dev, const struct ide_port_info *d)
* @d: IDE port info
* @bar: BAR number
*
* Checks if a BAR is configured and points to MMIO space. If so
* print an error and return an error code. Otherwise return 0
* Checks if a BAR is configured and points to MMIO space. If so,
* return an error code. Otherwise return 0
*/

static int ide_pci_check_iomem(struct pci_dev *dev, const struct ide_port_info *d, int bar)
static int ide_pci_check_iomem(struct pci_dev *dev, const struct ide_port_info *d,
int bar)
{
ulong flags = pci_resource_flags(dev, bar);

/* Unconfigured ? */
if (!flags || pci_resource_len(dev, bar) == 0)
return 0;

/* I/O space */
if(flags & PCI_BASE_ADDRESS_IO_MASK)
/* I/O space */
if (flags & IORESOURCE_IO)
return 0;

/* Bad */
printk(KERN_ERR "%s: IO baseregs (BIOS) are reported "
"as MEM, report to "
"<andre@linux-ide.org>.\n", d->name);
return -EINVAL;
}

Expand Down Expand Up @@ -348,9 +346,12 @@ static ide_hwif_t *ide_hwif_configure(struct pci_dev *dev,
struct hw_regs_s hw;

if ((d->host_flags & IDE_HFLAG_ISA_PORTS) == 0) {
/* Possibly we should fail if these checks report true */
ide_pci_check_iomem(dev, d, 2*port);
ide_pci_check_iomem(dev, d, 2*port+1);
if (ide_pci_check_iomem(dev, d, 2 * port) ||
ide_pci_check_iomem(dev, d, 2 * port + 1)) {
printk(KERN_ERR "%s: I/O baseregs (BIOS) are reported "
"as MEM for port %d!\n", d->name, port);
return NULL;
}

ctl = pci_resource_start(dev, 2*port+1);
base = pci_resource_start(dev, 2*port);
Expand Down

0 comments on commit 959e505

Please sign in to comment.