summary refs log tree commit diff
path: root/drivers/net/wwan/t7xx/t7xx_pci.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wwan/t7xx/t7xx_pci.c')
-rw-r--r--drivers/net/wwan/t7xx/t7xx_pci.c65
1 files changed, 3 insertions, 62 deletions
diff --git a/drivers/net/wwan/t7xx/t7xx_pci.c b/drivers/net/wwan/t7xx/t7xx_pci.c
index 14cdf00cac8e..871f2a27a398 100644
--- a/drivers/net/wwan/t7xx/t7xx_pci.c
+++ b/drivers/net/wwan/t7xx/t7xx_pci.c
@@ -38,9 +38,7 @@
 #include "t7xx_mhccif.h"
 #include "t7xx_modem_ops.h"
 #include "t7xx_pci.h"
-#include "t7xx_pci_rescan.h"
 #include "t7xx_pcie_mac.h"
-#include "t7xx_port_devlink.h"
 #include "t7xx_reg.h"
 #include "t7xx_state_monitor.h"
 
@@ -705,33 +703,22 @@ static int t7xx_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 	t7xx_pci_infracfg_ao_calc(t7xx_dev);
 	t7xx_mhccif_init(t7xx_dev);
 
-	ret = t7xx_devlink_register(t7xx_dev);
-	if (ret)
-		return ret;
-
 	ret = t7xx_md_init(t7xx_dev);
 	if (ret)
-		goto err_devlink_unregister;
+		return ret;
 
 	t7xx_pcie_mac_interrupts_dis(t7xx_dev);
 
 	ret = t7xx_interrupt_init(t7xx_dev);
 	if (ret) {
 		t7xx_md_exit(t7xx_dev);
-		goto err_devlink_unregister;
+		return ret;
 	}
 
-	t7xx_rescan_done();
 	t7xx_pcie_mac_set_int(t7xx_dev, MHCCIF_INT);
 	t7xx_pcie_mac_interrupts_en(t7xx_dev);
-	if (!t7xx_dev->hp_enable)
-		pci_ignore_hotplug(pdev);
 
 	return 0;
-
-err_devlink_unregister:
-	t7xx_devlink_unregister(t7xx_dev);
-	return ret;
 }
 
 static void t7xx_pci_remove(struct pci_dev *pdev)
@@ -741,7 +728,6 @@ static void t7xx_pci_remove(struct pci_dev *pdev)
 
 	t7xx_dev = pci_get_drvdata(pdev);
 	t7xx_md_exit(t7xx_dev);
-	t7xx_devlink_unregister(t7xx_dev);
 
 	for (i = 0; i < EXT_INT_NUM; i++) {
 		if (!t7xx_dev->intr_handler[i])
@@ -768,52 +754,7 @@ static struct pci_driver t7xx_pci_driver = {
 	.shutdown = t7xx_pci_shutdown,
 };
 
-static int __init t7xx_pci_init(void)
-{
-	int ret;
-
-	t7xx_pci_dev_rescan();
-	ret = t7xx_rescan_init();
-	if (ret) {
-		pr_err("Failed to init t7xx rescan work\n");
-		return ret;
-	}
-
-	return pci_register_driver(&t7xx_pci_driver);
-}
-module_init(t7xx_pci_init);
-
-static int t7xx_always_match(struct device *dev, const void *data)
-{
-	return dev->parent->fwnode == data;
-}
-
-static void __exit t7xx_pci_cleanup(void)
-{
-	int remove_flag = 0;
-	struct device *dev;
-
-	dev = driver_find_device(&t7xx_pci_driver.driver, NULL, NULL, t7xx_always_match);
-	if (dev) {
-		pr_debug("unregister t7xx PCIe driver while device is still exist.\n");
-		put_device(dev);
-		remove_flag = 1;
-	} else {
-		pr_debug("no t7xx PCIe driver found.\n");
-	}
-
-	pci_lock_rescan_remove();
-	pci_unregister_driver(&t7xx_pci_driver);
-	pci_unlock_rescan_remove();
-	t7xx_rescan_deinit();
-
-	if (remove_flag) {
-		pr_debug("remove t7xx PCI device\n");
-		pci_stop_and_remove_bus_device_locked(to_pci_dev(dev));
-	}
-}
-
-module_exit(t7xx_pci_cleanup);
+module_pci_driver(t7xx_pci_driver);
 
 MODULE_AUTHOR("MediaTek Inc");
 MODULE_DESCRIPTION("MediaTek PCIe 5G WWAN modem T7xx driver");