mirror of
https://github.com/torvalds/linux.git
synced 2026-01-25 15:03:52 +08:00
Merge branch 'pci/of'
- Unexport of_pci_parse_bus_range() since it's only used in of.c (Bjorn Helgaas) - Drop 'No bus range found' message so we don't complain when DTs don't specify the default 'bus-range = <0x00 0xff>' (Bjorn Helgaas) - Simplify devm_of_pci_get_host_bridge_resources() interface by dropping parameters that are always the same default values (Bjorn Helgaas) - Update comment reference to of_pci_get_host_bridge_resources(), which no longer exists (Bjorn Helgaas) - Rename the drivers/pci/of_property.c struct of_pci_range to of_pci_range_entry to avoid confusion with the global of_pci_range in include/linux/of_address.h (Bjorn Helgaas) * pci/of: PCI: of_property: Rename struct of_pci_range to of_pci_range_entry sparc/PCI: Update reference to devm_of_pci_get_host_bridge_resources() PCI: of: Simplify devm_of_pci_get_host_bridge_resources() interface PCI: of: Drop 'No bus range found' message PCI: Unexport of_pci_parse_bus_range()
This commit is contained in:
@@ -361,7 +361,7 @@ void pci_determine_mem_io_space(struct pci_pbm_info *pbm)
|
||||
int i, saw_mem, saw_io;
|
||||
int num_pbm_ranges;
|
||||
|
||||
/* Corresponding generic code in of_pci_get_host_bridge_resources() */
|
||||
/* Corresponds to generic devm_of_pci_get_host_bridge_resources() */
|
||||
|
||||
saw_mem = saw_io = 0;
|
||||
pbm_ranges = of_get_property(pbm->op->dev.of_node, "ranges", &i);
|
||||
|
||||
@@ -190,7 +190,8 @@ EXPORT_SYMBOL_GPL(of_pci_get_devfn);
|
||||
*
|
||||
* Returns 0 on success or a negative error-code on failure.
|
||||
*/
|
||||
int of_pci_parse_bus_range(struct device_node *node, struct resource *res)
|
||||
static int of_pci_parse_bus_range(struct device_node *node,
|
||||
struct resource *res)
|
||||
{
|
||||
u32 bus_range[2];
|
||||
int error;
|
||||
@@ -207,7 +208,6 @@ int of_pci_parse_bus_range(struct device_node *node, struct resource *res)
|
||||
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(of_pci_parse_bus_range);
|
||||
|
||||
/**
|
||||
* of_get_pci_domain_nr - Find the host bridge domain number
|
||||
@@ -302,8 +302,6 @@ EXPORT_SYMBOL_GPL(of_pci_check_probe_only);
|
||||
* devm_of_pci_get_host_bridge_resources() - Resource-managed parsing of PCI
|
||||
* host bridge resources from DT
|
||||
* @dev: host bridge device
|
||||
* @busno: bus number associated with the bridge root bus
|
||||
* @bus_max: maximum number of buses for this bridge
|
||||
* @resources: list where the range of resources will be added after DT parsing
|
||||
* @ib_resources: list where the range of inbound resources (with addresses
|
||||
* from 'dma-ranges') will be added after DT parsing
|
||||
@@ -319,7 +317,6 @@ EXPORT_SYMBOL_GPL(of_pci_check_probe_only);
|
||||
* value if it failed.
|
||||
*/
|
||||
static int devm_of_pci_get_host_bridge_resources(struct device *dev,
|
||||
unsigned char busno, unsigned char bus_max,
|
||||
struct list_head *resources,
|
||||
struct list_head *ib_resources,
|
||||
resource_size_t *io_base)
|
||||
@@ -343,14 +340,15 @@ static int devm_of_pci_get_host_bridge_resources(struct device *dev,
|
||||
|
||||
err = of_pci_parse_bus_range(dev_node, bus_range);
|
||||
if (err) {
|
||||
bus_range->start = busno;
|
||||
bus_range->end = bus_max;
|
||||
bus_range->start = 0;
|
||||
bus_range->end = 0xff;
|
||||
bus_range->flags = IORESOURCE_BUS;
|
||||
dev_info(dev, " No bus range found for %pOF, using %pR\n",
|
||||
dev_node, bus_range);
|
||||
} else {
|
||||
if (bus_range->end > bus_range->start + bus_max)
|
||||
bus_range->end = bus_range->start + bus_max;
|
||||
if (bus_range->end > 0xff) {
|
||||
dev_warn(dev, " Invalid end bus number in %pR, defaulting to 0xff\n",
|
||||
bus_range);
|
||||
bus_range->end = 0xff;
|
||||
}
|
||||
}
|
||||
pci_add_resource(resources, bus_range);
|
||||
|
||||
@@ -597,7 +595,7 @@ static int pci_parse_request_of_pci_ranges(struct device *dev,
|
||||
INIT_LIST_HEAD(&bridge->windows);
|
||||
INIT_LIST_HEAD(&bridge->dma_ranges);
|
||||
|
||||
err = devm_of_pci_get_host_bridge_resources(dev, 0, 0xff, &bridge->windows,
|
||||
err = devm_of_pci_get_host_bridge_resources(dev, &bridge->windows,
|
||||
&bridge->dma_ranges, &iobase);
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
@@ -26,7 +26,7 @@ struct of_pci_addr_pair {
|
||||
* side and the child address is the corresponding address on the secondary
|
||||
* side.
|
||||
*/
|
||||
struct of_pci_range {
|
||||
struct of_pci_range_entry {
|
||||
u32 child_addr[OF_PCI_ADDRESS_CELLS];
|
||||
u32 parent_addr[OF_PCI_ADDRESS_CELLS];
|
||||
u32 size[OF_PCI_SIZE_CELLS];
|
||||
@@ -101,7 +101,7 @@ static int of_pci_prop_bus_range(struct pci_dev *pdev,
|
||||
static int of_pci_prop_ranges(struct pci_dev *pdev, struct of_changeset *ocs,
|
||||
struct device_node *np)
|
||||
{
|
||||
struct of_pci_range *rp;
|
||||
struct of_pci_range_entry *rp;
|
||||
struct resource *res;
|
||||
int i, j, ret;
|
||||
u32 flags, num;
|
||||
|
||||
@@ -808,7 +808,6 @@ static inline u64 pci_rebar_size_to_bytes(int size)
|
||||
struct device_node;
|
||||
|
||||
#ifdef CONFIG_OF
|
||||
int of_pci_parse_bus_range(struct device_node *node, struct resource *res);
|
||||
int of_get_pci_domain_nr(struct device_node *node);
|
||||
int of_pci_get_max_link_speed(struct device_node *node);
|
||||
u32 of_pci_get_slot_power_limit(struct device_node *node,
|
||||
@@ -824,12 +823,6 @@ int devm_of_pci_bridge_init(struct device *dev, struct pci_host_bridge *bridge);
|
||||
bool of_pci_supply_present(struct device_node *np);
|
||||
|
||||
#else
|
||||
static inline int
|
||||
of_pci_parse_bus_range(struct device_node *node, struct resource *res)
|
||||
{
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
static inline int
|
||||
of_get_pci_domain_nr(struct device_node *node)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user