[PATCH v2 4/4] ipack: tpci200: move tpci200_unregister close to tpci200_register

From: Dongliang Mu
Date: Mon Aug 09 2021 - 10:33:02 EST


Move tpci200_unregister close to tpci200_register, then it is easier to
review the code related to the registration and unregistration

Signed-off-by: Dongliang Mu <mudongliangabcd@xxxxxxxxx>
---
drivers/ipack/carriers/tpci200.c | 28 ++++++++++++++--------------
1 file changed, 14 insertions(+), 14 deletions(-)

diff --git a/drivers/ipack/carriers/tpci200.c b/drivers/ipack/carriers/tpci200.c
index 307f94f59c18..d553b4941539 100644
--- a/drivers/ipack/carriers/tpci200.c
+++ b/drivers/ipack/carriers/tpci200.c
@@ -84,20 +84,6 @@ static void tpci200_set_mask(struct tpci200_board *tpci200,
spin_unlock_irqrestore(&tpci200->regs_lock, flags);
}

-static void tpci200_unregister(struct tpci200_board *tpci200)
-{
- free_irq(tpci200->info->pdev->irq, (void *) tpci200);
-
- iounmap(tpci200->info->pdev, tpci200->info->interface_regs);
-
- pci_release_region(tpci200->info->pdev, TPCI200_IP_INTERFACE_BAR);
- pci_release_region(tpci200->info->pdev, TPCI200_IO_ID_INT_SPACES_BAR);
- pci_release_region(tpci200->info->pdev, TPCI200_MEM16_SPACE_BAR);
- pci_release_region(tpci200->info->pdev, TPCI200_MEM8_SPACE_BAR);
-
- pci_disable_device(tpci200->info->pdev);
-}
-
static void tpci200_enable_irq(struct tpci200_board *tpci200,
int islot)
{
@@ -236,6 +222,20 @@ static int tpci200_request_irq(struct ipack_device *dev,
return res;
}

+static void tpci200_unregister(struct tpci200_board *tpci200)
+{
+ free_irq(tpci200->info->pdev->irq, (void *) tpci200);
+
+ iounmap(tpci200->info->pdev, tpci200->info->interface_regs);
+
+ pci_release_region(tpci200->info->pdev, TPCI200_IP_INTERFACE_BAR);
+ pci_release_region(tpci200->info->pdev, TPCI200_IO_ID_INT_SPACES_BAR);
+ pci_release_region(tpci200->info->pdev, TPCI200_MEM16_SPACE_BAR);
+ pci_release_region(tpci200->info->pdev, TPCI200_MEM8_SPACE_BAR);
+
+ pci_disable_device(tpci200->info->pdev);
+}
+
static int tpci200_register(struct tpci200_board *tpci200)
{
int i;
--
2.25.1