lkml.org 
[lkml]   [2004]   [Jul]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: Exposing ROM's though sysfs
Date
On Friday, July 30, 2004 12:55 pm, Greg KH wrote:
> 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.)

Yep, that's pretty broken. I guess I need to allocate a pci_rom_attr every
time we see a ROM... Where would the cleanup code go though? In one of the
hotplug remove paths?

Jesse
-
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 14:04    [W:0.533 / U:0.260 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site