aboutsummaryrefslogtreecommitdiff
path: root/drivers/scsi/mpt2sas/mpi/mpi2_raid.h
diff options
context:
space:
mode:
authorAndrew Murray <[email protected]>2013-05-16 17:55:17 +0200
committerJason Cooper <[email protected]>2013-05-19 20:29:55 +0000
commit29b635c00f3ebcdaf7a52c4948f6d948ad3757d3 (patch)
treea6e09cffad345acacef84d646d7b91c005e91a4d /drivers/scsi/mpt2sas/mpi/mpi2_raid.h
parentf722406faae2d073cc1d01063d1123c35425939e (diff)
of/pci: Provide support for parsing PCI DT ranges property
This patch factors out common implementation patterns to reduce overall kernel code and provide a means for host bridge drivers to directly obtain struct resources from the DT's ranges property without relying on architecture specific DT handling. This will make it easier to write archiecture independent host bridge drivers and mitigate against further duplication of DT parsing code. This patch can be used in the following way: struct of_pci_range_parser parser; struct of_pci_range range; if (of_pci_range_parser_init(&parser, np)) ; //no ranges property for_each_of_pci_range(&parser, &range) { /* directly access properties of the address range, e.g.: range.pci_space, range.pci_addr, range.cpu_addr, range.size, range.flags alternatively obtain a struct resource, e.g.: struct resource res; of_pci_range_to_resource(&range, np, &res); */ } Additionally the implementation takes care of adjacent ranges and merges them into a single range (as was the case with powerpc and microblaze). Signed-off-by: Andrew Murray <[email protected]> Signed-off-by: Liviu Dudau <[email protected]> Signed-off-by: Thomas Petazzoni <[email protected]> Reviewed-by: Rob Herring <[email protected]> Tested-by: Thomas Petazzoni <[email protected]> Tested-by: Linus Walleij <[email protected]> Tested-by: Jingoo Han <[email protected]> Acked-by: Grant Likely <[email protected]> Signed-off-by: Jason Cooper <[email protected]>
Diffstat (limited to 'drivers/scsi/mpt2sas/mpi/mpi2_raid.h')
0 files changed, 0 insertions, 0 deletions