Re: Exposing ROM's though sysfs

Greg KH
2004-07-30T19:56:51Z

On Fri, Jul 30, 2004 at 11:49:39AM -0700, Jesse Barnes wrote:
> +
> + /* If the device has a ROM, map it */
> + if (pci_resource_len(pdev, PCI_ROM_RESOURCE)) {
> + pci_rom_attr.size = pci_resource_len(pdev, PCI_ROM_RESOURCE);
> + sysfs_create_bin_file(&pdev->dev.kobj, &pci_rom_attr);
> + }

Doesn't this code cause _all_ rom sizes to be the same, as you only have
1 pci_rom_attr variable? You should create a new one for every pci
device (making sure to clean it up when the device is removed.)

thanks,

greg k-h