lkml.org 
[lkml]   [2003]   [Aug]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Standard driver call to enable/disable PCI ROM
On Tue, Aug 19, 2003 at 12:45:03PM -0700, Jon Smirl wrote:
> Here's the code I used...
>
> static void * __init aty128_map_ROM(struct pci_dev
> *dev, const struct aty128fb_par
> *par)
> {
> void *rom;
> struct resource *r =
> &dev->resource[PCI_ROM_RESOURCE];
>
> /* assign address if it doesn't have one */
> if (r->start == 0)
> pci_assign_resource(dev,
> PCI_ROM_RESOURCE);
>
> /* enable if needed */
> if (!(r->flags & PCI_ROM_ADDRESS_ENABLE)) {
> pci_write_config_dword(dev,
> dev->rom_base_reg, r->start |
^^^^^^^^^

This is non-portable.

You should use pcibios_resource_to_bus() to convert a resource to a
representation suitable for a BAR.

--
Russell King (rmk@arm.linux.org.uk) The developer of ARM Linux
http://www.arm.linux.org.uk/personal/aboutme.html

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:47    [W:0.200 / U:0.168 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site