Re: Exposing ROM's though sysfs

Christoph Hellwig
2004-07-30T17:24:19Z

On Fri, Jul 30, 2004 at 10:10:29AM -0700, Jesse Barnes wrote:
> + unsigned long start = dev->resource[PCI_ROM_RESOURCE].start;
> + int size = dev->resource[PCI_ROM_RESOURCE].end -
> + dev->resource[PCI_ROM_RESOURCE].start;

pci_resource_start and pci_resource_len please.

> + .name = "rom",
> + .mode = S_IRUGO | S_IWUSR,

do we really want it world readable if a read messes with pci config
space?

> + if (pdev->resource[PCI_ROM_RESOURCE].start) {
> + pci_rom_attr.size = pdev->resource[PCI_ROM_RESOURCE].end -
> + pdev->resource[PCI_ROM_RESOURCE].start;

as above.