[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210809143049.3531188-4-mudongliangabcd@gmail.com>
Date: Mon, 9 Aug 2021 22:30:29 +0800
From: Dongliang Mu <mudongliangabcd@...il.com>
To: Samuel Iglesias Gonsalvez <siglesias@...lia.com>,
Jens Taprogge <jens.taprogge@...rogge.org>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Dongliang Mu <mudongliangabcd@...il.com>,
Lv Yunlong <lyl2019@...l.ustc.edu.cn>,
Randy Dunlap <rdunlap@...radead.org>,
Aditya Srivastava <yashsri421@...il.com>
Cc: industrypack-devel@...ts.sourceforge.net,
linux-kernel@...r.kernel.org
Subject: [PATCH v2 4/4] ipack: tpci200: move tpci200_unregister close to tpci200_register
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@...il.com>
---
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
Powered by blists - more mailing lists