From: Bjorn Helgaas <helgaas@kernel.org>
To: Rob Herring <robh@kernel.org>
Cc: "David S . Miller" <davem@davemloft.net>,
Andreas Larsson <andreas@gaisler.com>,
sparclinux@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-pci@vger.kernel.org, Bjorn Helgaas <bhelgaas@google.com>
Subject: Re: [PATCH 2/3] PCI: of: Simplify bus range parsing
Date: Fri, 3 Jan 2025 15:36:31 -0600 [thread overview]
Message-ID: <20250103213631.GA6246@bhelgaas> (raw)
In-Reply-To: <20250103213129.5182-3-helgaas@kernel.org>
On Fri, Jan 03, 2025 at 03:31:28PM -0600, Bjorn Helgaas wrote:
> From: Bjorn Helgaas <bhelgaas@google.com>
>
> of_pci_parse_bus_range() looks for a DT "bus-range" property. If none
> exists, devm_of_pci_get_host_bridge_resources() defaults to the [bus 00-ff]
> range supplied by its caller, pci_parse_request_of_pci_ranges().
>
> devm_of_pci_get_host_bridge_resources() is static and has no other callers,
> so there's no reason to complicate its interface by passing the default bus
> range.
> @@ -343,8 +340,8 @@ 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);
Hmm, would have been better if I'd compiled this first to notice the
build error, sorry about that:
drivers/pci/of.c: In function ‘devm_of_pci_get_host_bridge_resources’:
drivers/pci/of.c:349:57: error: ‘bus_max’ undeclared (first use in this function)
349 | if (bus_range->end > bus_range->start + bus_max)
| ^~~~~~~
Will fix.
next prev parent reply other threads:[~2025-01-03 21:36 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-03 21:31 [PATCH 0/3] PCI: Simplify bus range parsing Bjorn Helgaas
2025-01-03 21:31 ` [PATCH 1/3] PCI: Unexport of_pci_parse_bus_range() Bjorn Helgaas
2025-01-07 14:52 ` Rob Herring
2025-01-03 21:31 ` [PATCH 2/3] PCI: of: Simplify bus range parsing Bjorn Helgaas
2025-01-03 21:36 ` Bjorn Helgaas [this message]
2025-01-03 21:38 ` Bjorn Helgaas
2025-01-07 14:46 ` Rob Herring
2025-01-04 7:23 ` kernel test robot
2025-01-04 8:39 ` kernel test robot
2025-01-03 21:31 ` [PATCH 3/3] sparc/PCI: Update reference to devm_of_pci_get_host_bridge_resources() Bjorn Helgaas
2025-01-07 13:03 ` Andreas Larsson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250103213631.GA6246@bhelgaas \
--to=helgaas@kernel.org \
--cc=andreas@gaisler.com \
--cc=bhelgaas@google.com \
--cc=davem@davemloft.net \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=robh@kernel.org \
--cc=sparclinux@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox