All of lore.kernel.org
 help / color / mirror / Atom feed
* [LTP] Subject: [PATCH] Update legacy codes in ltp_tpci.c
@ 2020-03-07  7:14 Chen Li
  2020-03-13 14:07 ` Petr Vorel
  0 siblings, 1 reply; 2+ messages in thread
From: Chen Li @ 2020-03-07  7:14 UTC (permalink / raw)
  To: ltp

The kernel api used in ltp_tpci.c is too old and connot pass compile
after 3.12.

Signed-off-by: Li Chen <chenli@uniontech.com>
---
 .../device-drivers/pci/tpci_kernel/ltp_tpci.c | 30 ++-----------------
 1 file changed, 2 insertions(+), 28 deletions(-)

diff --git a/testcases/kernel/device-drivers/pci/tpci_kernel/ltp_tpci.c b/testcases/kernel/device-drivers/pci/tpci_kernel/ltp_tpci.c
index 2cf8cefc8..7cbabfaa5 100644
--- a/testcases/kernel/device-drivers/pci/tpci_kernel/ltp_tpci.c
+++ b/testcases/kernel/device-drivers/pci/tpci_kernel/ltp_tpci.c
@@ -61,7 +61,7 @@ MODULE_LICENSE("GPL");
 #define TFAIL	1
 #define TSKIP	32

-static DEFINE_PCI_DEVICE_TABLE(ltp_pci_tbl) = {
+static const struct pci_device_id ltp_pci_tbl[] = {
 	{ PCI_DEVICE(PCI_ANY_ID, PCI_ANY_ID) },
 	{ 0, }
 };
@@ -104,7 +104,7 @@ static int probe_pci_dev(unsigned int bus, unsigned int slot)
 		ltp_pci.dev = NULL;
 	}

-	dev = pci_get_bus_and_slot(bus, slot);
+	dev = pci_get_domain_bus_and_slot(pci_domain_nr(dev->bus), bus, slot);
 	if (!dev || !dev->driver)
 		return -ENODEV;

@@ -360,29 +360,6 @@ static int test_bus_add_devices(void)
 	return TFAIL;
 }

-/*
- * test_enable_bridges
- *	make call to pci_enable_bridges,
- *	use bus pointer from the ltp_pci
- *	structure
- */
-static int test_enable_bridges(void)
-{
-	struct pci_bus *bus = ltp_pci.bus;
-
-	prk_info("enable bridges");
-
-	pci_enable_bridges(bus);
-
-	if (bus) {
-		prk_info("called enable bridges");
-		return TPASS;
-	}
-
-	prk_err("enable_bridges failed");
-	return TFAIL;
-}
-
 /*
  * test_match_device
  *	make call to pci_match_device, returns a
@@ -609,9 +586,6 @@ static int test_case(unsigned int cmd)
 	case BUS_ADD_DEVICES:
 		rc = test_bus_add_devices();
 		break;
-	case ENABLE_BRIDGES:
-		rc = test_enable_bridges();
-		break;
 	case MATCH_DEVICE:
 		rc = test_match_device();
 		break;
--
2.25.0



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

* [LTP] Subject: [PATCH] Update legacy codes in ltp_tpci.c
  2020-03-07  7:14 [LTP] Subject: [PATCH] Update legacy codes in ltp_tpci.c Chen Li
@ 2020-03-13 14:07 ` Petr Vorel
  0 siblings, 0 replies; 2+ messages in thread
From: Petr Vorel @ 2020-03-13 14:07 UTC (permalink / raw)
  To: ltp

Hi,


> The kernel api used in ltp_tpci.c is too old and connot pass compile
> after 3.12.
Merged as obviously correct.
I added git commit references.

BTW whole pci is not used atm.
We should decide for versions we want to support and then update kernel
versions, which are now wrongly set to 2.6:

REQ_VERSION_MAJOR := 2
REQ_VERSION_PATCH := 6

This waits for project to define which kernel versions we support.
We had some discussion about it in the past, I just cannot find it,
so I'll probably send a new mail about it.

Kind regards,
Petr

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

end of thread, other threads:[~2020-03-13 14:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-07  7:14 [LTP] Subject: [PATCH] Update legacy codes in ltp_tpci.c Chen Li
2020-03-13 14:07 ` Petr Vorel

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.