linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH V4 04/26] ata: deprecate pci_get_bus_and_slot()
       [not found] <1513661883-28662-1-git-send-email-okaya@codeaurora.org>
@ 2017-12-19  5:37 ` Sinan Kaya
  2017-12-19  5:37 ` [PATCH V4 10/26] Drivers: ide: " Sinan Kaya
  1 sibling, 0 replies; 3+ messages in thread
From: Sinan Kaya @ 2017-12-19  5:37 UTC (permalink / raw)
  To: linux-pci, timur
  Cc: linux-arm-msm, linux-arm-kernel, Sinan Kaya,
	Bartlomiej Zolnierkiewicz, Tejun Heo,
	open list:LIBATA PATA DRIVERS, open list

pci_get_bus_and_slot() is restrictive such that it assumes domain=0 as
where a PCI device is present. This restricts the device drivers to be
reused for other domain numbers.

Getting ready to remove pci_get_bus_and_slot() function in favor of
pci_get_domain_bus_and_slot().

Use pci_get_domain_bus_and_slot() and extract the actual domain number
from the pdev passed in.

Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
Acked-by: Tejun Heo <tj@kernel.org>
---
 drivers/ata/pata_ali.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/ata/pata_ali.c b/drivers/ata/pata_ali.c
index d19cd88..0b122f9 100644
--- a/drivers/ata/pata_ali.c
+++ b/drivers/ata/pata_ali.c
@@ -466,7 +466,8 @@ static void ali_init_chipset(struct pci_dev *pdev)
 			tmp |= 0x01;	/* CD_ROM enable for DMA */
 		pci_write_config_byte(pdev, 0x53, tmp);
 	}
-	north = pci_get_bus_and_slot(0, PCI_DEVFN(0,0));
+	north = pci_get_domain_bus_and_slot(pci_domain_nr(pdev->bus), 0,
+					    PCI_DEVFN(0, 0));
 	if (north && north->vendor == PCI_VENDOR_ID_AL && ali_isa_bridge) {
 		/* Configure the ALi bridge logic. For non ALi rely on BIOS.
 		   Set the south bridge enable bit */
-- 
1.9.1

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

* [PATCH V4 10/26] Drivers: ide: deprecate pci_get_bus_and_slot()
       [not found] <1513661883-28662-1-git-send-email-okaya@codeaurora.org>
  2017-12-19  5:37 ` [PATCH V4 04/26] ata: deprecate pci_get_bus_and_slot() Sinan Kaya
@ 2017-12-19  5:37 ` Sinan Kaya
  2017-12-19 14:13   ` David Miller
  1 sibling, 1 reply; 3+ messages in thread
From: Sinan Kaya @ 2017-12-19  5:37 UTC (permalink / raw)
  To: linux-pci, timur
  Cc: linux-arm-msm, linux-arm-kernel, Sinan Kaya, David S. Miller,
	open list:IDE SUBSYSTEM, open list

pci_get_bus_and_slot() is restrictive such that it assumes domain=0 as
where a PCI device is present. This restricts the device drivers to be
reused for other domain numbers.

Getting ready to remove pci_get_bus_and_slot() function in favor of
pci_get_domain_bus_and_slot().

Replace pci_get_bus_and_slot() with pci_get_domain_bus_and_slot()
and extract the domain number from struct pci_dev.

Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
---
 drivers/ide/sl82c105.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/ide/sl82c105.c b/drivers/ide/sl82c105.c
index 8755df3..3300dac 100644
--- a/drivers/ide/sl82c105.c
+++ b/drivers/ide/sl82c105.c
@@ -239,8 +239,9 @@ static u8 sl82c105_bridge_revision(struct pci_dev *dev)
 	/*
 	 * The bridge should be part of the same device, but function 0.
 	 */
-	bridge = pci_get_bus_and_slot(dev->bus->number,
-			       PCI_DEVFN(PCI_SLOT(dev->devfn), 0));
+	bridge = pci_get_domain_bus_and_slot(pci_domain_nr(dev->bus),
+					dev->bus->number,
+					PCI_DEVFN(PCI_SLOT(dev->devfn), 0));
 	if (!bridge)
 		return -1;
 
-- 
1.9.1

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

* Re: [PATCH V4 10/26] Drivers: ide: deprecate pci_get_bus_and_slot()
  2017-12-19  5:37 ` [PATCH V4 10/26] Drivers: ide: " Sinan Kaya
@ 2017-12-19 14:13   ` David Miller
  0 siblings, 0 replies; 3+ messages in thread
From: David Miller @ 2017-12-19 14:13 UTC (permalink / raw)
  To: okaya
  Cc: linux-pci, timur, linux-arm-msm, linux-arm-kernel, linux-ide,
	linux-kernel

From: Sinan Kaya <okaya@codeaurora.org>
Date: Tue, 19 Dec 2017 00:37:46 -0500

> pci_get_bus_and_slot() is restrictive such that it assumes domain=0 as
> where a PCI device is present. This restricts the device drivers to be
> reused for other domain numbers.
> 
> Getting ready to remove pci_get_bus_and_slot() function in favor of
> pci_get_domain_bus_and_slot().
> 
> Replace pci_get_bus_and_slot() with pci_get_domain_bus_and_slot()
> and extract the domain number from struct pci_dev.
> 
> Signed-off-by: Sinan Kaya <okaya@codeaurora.org>

Acked-by: David S. Miller <davem@davemloft.net>

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

end of thread, other threads:[~2017-12-19 14:13 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <1513661883-28662-1-git-send-email-okaya@codeaurora.org>
2017-12-19  5:37 ` [PATCH V4 04/26] ata: deprecate pci_get_bus_and_slot() Sinan Kaya
2017-12-19  5:37 ` [PATCH V4 10/26] Drivers: ide: " Sinan Kaya
2017-12-19 14:13   ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).