public inbox for linux-pci@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] PCI: Add and use pcim_iomap_region()
@ 2024-03-27 11:52 Heiner Kallweit
  2024-03-27 11:53 ` [PATCH 1/2] PCI: Add pcim_iomap_region Heiner Kallweit
                   ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Heiner Kallweit @ 2024-03-27 11:52 UTC (permalink / raw)
  To: Bjorn Helgaas, Realtek linux nic maintainers, Paolo Abeni,
	Jakub Kicinski, Eric Dumazet, David Miller
  Cc: linux-pci@vger.kernel.org, netdev@vger.kernel.org

Several drivers use the following sequence for a single BAR:
rc = pcim_iomap_regions(pdev, BIT(bar), name);
if (rc)
	error;
addr = pcim_iomap_table(pdev)[bar];

Let's create a simpler (from implementation and usage perspective)
pcim_iomap_region() for this use case.

Note: The check for !pci_resource_len() is included in
pcim_iomap(), so we don't have to duplicate it.

Make r8169 the first user of the new function.

I'd prefer to handle this via the PCI tree.

Heiner Kallweit (2):
  PCI: Add pcim_iomap_region
  r8169: use new function pcim_iomap_region()

 drivers/net/ethernet/realtek/r8169_main.c |  8 +++----
 drivers/pci/devres.c                      | 28 +++++++++++++++++++++++
 include/linux/pci.h                       |  2 ++
 3 files changed, 33 insertions(+), 5 deletions(-)

-- 
2.44.0


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2024-04-02 19:06 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-27 11:52 [PATCH 0/2] PCI: Add and use pcim_iomap_region() Heiner Kallweit
2024-03-27 11:53 ` [PATCH 1/2] PCI: Add pcim_iomap_region Heiner Kallweit
2024-03-27 11:54 ` [PATCH 2/2] r8169: use new function pcim_iomap_region() Heiner Kallweit
2024-03-27 13:35   ` Philipp Stanner
2024-03-27 13:20 ` [PATCH 0/2] PCI: Add and use pcim_iomap_region() Philipp Stanner
2024-03-28 17:35   ` Heiner Kallweit
2024-03-28 22:03     ` Heiner Kallweit
2024-04-02 13:17       ` Philipp Stanner
2024-04-02 13:54         ` Heiner Kallweit
2024-04-02 14:11           ` Philipp Stanner
2024-04-02 19:06             ` Heiner Kallweit
2024-04-02 13:40     ` Philipp Stanner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox