Re: Exposing ROM's though sysfs

From: Greg KH (greg_at_kroah.com)
Date: 07/30/04

  • Next message: Jon Smirl: "Re: Exposing ROM's though sysfs"
    Date:	Fri, 30 Jul 2004 13:29:14 -0700
    To: Jesse Barnes <jbarnes@engr.sgi.com>
    
    

    On Fri, Jul 30, 2004 at 01:16:14PM -0700, Jesse Barnes wrote:
    > 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?

    We need to create a pci_remove_sysfs_dev_files() call, and call it when
    the pci device is about to be unregistered (in pci_destroy_dev(), just
    before the call to device_unregister()).

    thanks,

    greg k-h
    -
    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/


  • Next message: Jon Smirl: "Re: Exposing ROM's though sysfs"

    Relevant Pages

    • Re: module-init-tools - input devices id support
      ... This is the first time I've looked at the input code, ... at least so I was assured by Greg. ... But it's designed for the hotplug stuff. ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: [patch 09/14] x86_64: Dont call enforce_max_cpus when hotplug is enabled
      ... > Hi Andi ... If that is not possible it's better to always use the sequence mechanism. ... as I wrote earlier hotplug should be removed. ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Bigphysarea patch and 2.6, advice requested
      ... of memory for the purposes of DMA for various custom made PCI cards. ... have read in a couple of posts that when the PCI device supports ... scatter/gather mechanism implemented on board. ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: -mm -> 2.6.13 merge status
      ... fails totally in a single routine. ... then putting all of the cleanup code in a ... single function and using the enums eliminates duplicate code and ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: Call for help: list of machines with working S3
      ... > video). ... Acer Travelmate 803LCi, working Suspend to ram: ... * hotplug ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)