Re: [patch 2.6.24-rc1] resource_len() utility function

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Alan Cox wrote:
On Wed, 24 Oct 2007 18:20:52 -0700
David Brownell <[email protected]> wrote:

Add a new resource_len() function, so drivers can start using this
instead of driver-private code for a common idiom.  The call can be
useful with at least:

 - request_region(), release_region()
 - request_mem_region(), release_mem_region()
 - ioremap()

Candidate drivers include those using platform or PNP busses, and
maybe some others.  PCI already has a similar function.

This patch also updates a representative set of drivers in two
subsystems to use this call (SPI, and USB peripheral/gadget).

PCI also increasingly is using functions that allow the user to choose to
map a resource as a resource (eg pci_iomap). So is it better to have
functions request_mem_resource(res)  free_mem_resource(res) and similar
instead or as well ?


With regards to resource reservation... IMO we should mimic struct pci_dev and add struct resource[] to struct device.

Just like we have pci_request_regions(), we should also be able to easily to a dev_request_regions(). the implementation should be very close to pci_request_region() and pci_release_region().

Then a dev_iomap() analogue to pci_iomap() should be pretty straightforward to create.

	Jeff


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

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux