Skip to contentSkip to conversation

bcma: Use dev_get_drvdata

PATCH In review Chuhong Yuan 2 participants 2 messages Jul 23, 2019 – Aug 6, 2019 Broadcom specific amba driver (bcma)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 bcma: Use dev_get_drvdata

Instead of using to_pci_dev + pci_get_drvdata,
use dev_get_drvdata to make code simpler.

---
 drivers/bcma/host_pci.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/bcma/host_pci.c +2 -4
index f52239feb4cb..69c10a7b7c61 100644
@@ -260,8 +260,7 @@ static void bcma_host_pci_remove(struct pci_dev *dev)
 #ifdef CONFIG_PM_SLEEP
 static int bcma_host_pci_suspend(struct device *dev)
 {
-	struct pci_dev *pdev = to_pci_dev(dev);
-	struct bcma_bus *bus = pci_get_drvdata(pdev);
+	struct bcma_bus *bus = dev_get_drvdata(dev);
 
 	bus->mapped_core = NULL;
 
@@ -270,8 +269,7 @@ static int bcma_host_pci_suspend(struct device *dev)
 
 static int bcma_host_pci_resume(struct device *dev)
 {
-	struct pci_dev *pdev = to_pci_dev(dev);
-	struct bcma_bus *bus = pci_get_drvdata(pdev);
+	struct bcma_bus *bus = dev_get_drvdata(dev);
 
 	return bcma_bus_resume(bus);
 }
Signature · 1 line
2.20.1
#1 lore raw
Quoted 4 lines · Chuhong Yuan

Instead of using to_pci_dev + pci_get_drvdata,
use dev_get_drvdata to make code simpler.

Patch applied to wireless-drivers-next.git, thanks.

9236c1250cb7 bcma: Use dev_get_drvdata

Signature · 3 lines
https://patchwork.kernel.org/patch/11054111/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches