From 960fa2145c13ef68b5c077dc1569ade4d1a880e0 Mon Sep 17 00:00:00 2001 From: Yuanyuan Liu Date: Tue, 24 May 2016 17:15:43 -0700 Subject: [PATCH] qcacld-3.0: Fix error of invalid dev type when unloading wlan PLD deletes dev node before calling HDD remove callback functions. It causes an error of reporting invalid dev type when a platform API is called within remove callback function. Deleting dev node after remove callback being called will fix the issue. CRs-Fixed: 1020538 Change-Id: I3df5810c20a5965b908f15d4182e9b927e033afc --- core/pld/src/pld_pcie.c | 4 ++-- core/pld/src/pld_snoc.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/core/pld/src/pld_pcie.c b/core/pld/src/pld_pcie.c index 2b918b8c0c31..84175cda1964 100644 --- a/core/pld/src/pld_pcie.c +++ b/core/pld/src/pld_pcie.c @@ -109,6 +109,8 @@ static void pld_pcie_remove(struct pci_dev *pdev) if (!pld_context) return; + pld_context->ops->remove(&pdev->dev, PLD_BUS_TYPE_PCIE); + spin_lock_irqsave(&pld_context->pld_lock, flags); list_for_each_entry_safe(dev_node, tmp, &pld_context->dev_list, list) { if (dev_node->dev == &pdev->dev) { @@ -117,8 +119,6 @@ static void pld_pcie_remove(struct pci_dev *pdev) } } spin_unlock_irqrestore(&pld_context->pld_lock, flags); - - pld_context->ops->remove(&pdev->dev, PLD_BUS_TYPE_PCIE); } #ifdef CONFIG_CNSS diff --git a/core/pld/src/pld_snoc.c b/core/pld/src/pld_snoc.c index 40cee705ea9d..b2d0446a2796 100644 --- a/core/pld/src/pld_snoc.c +++ b/core/pld/src/pld_snoc.c @@ -99,6 +99,8 @@ static void pld_snoc_remove(struct device *dev) if (!pld_context) return; + pld_context->ops->remove(dev, PLD_BUS_TYPE_SNOC); + spin_lock_irqsave(&pld_context->pld_lock, flags); list_for_each_entry_safe(dev_node, tmp, &pld_context->dev_list, list) { if (dev_node->dev == dev) { @@ -107,8 +109,6 @@ static void pld_snoc_remove(struct device *dev) } } spin_unlock_irqrestore(&pld_context->pld_lock, flags); - - pld_context->ops->remove(dev, PLD_BUS_TYPE_SNOC); } /**